【mongoDB】mongoDB 索引创建示例

2022-11-02  本文已影响0人  Bogon

$ cat create_index.js

var testDB = db.getSisterDB('testDB');

testDB.testColl.createIndex({
    "activityInstId" : 1
}, {"background":true});

testDB.testColl.createIndex({
    "flowInstId" : 1
}, {"background":true});

testDB.testColl.createIndex({
    "taskId" : 1
}, {"background":true});

testDB.testColl.createIndex({
    "eid" : 1,
    "timeout" : 1,
    "flowStatus" : 1,
    "overtime" : 1
}, {"background":true});

testDB.testColl.createIndex({
    "handler" : 1,
    "timeout" : 1
}, {"background":true});

testDB.testColl.createIndex({
    "eid" : 1,
    "handleTime" : 1,
    "handlerOrgLongNum" : 1
}, {"background":true});

print('索引建立完成!');
上一篇 下一篇

猜你喜欢

热点阅读