美文网首页
【mongoDB】mongoDB 索引创建示例

【mongoDB】mongoDB 索引创建示例

作者: Bogon | 来源:发表于2022-11-02 16:50 被阅读0次

$ 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('索引建立完成!');

相关文章

网友评论

      本文标题:【mongoDB】mongoDB 索引创建示例

      本文链接:https://www.haomeiwen.com/subject/dscjtdtx.html