随笔分类 -  mongo / mongo索引

摘要:列出数据库的所有索引 db.getCollectionNames().forEach(function(collection) { indexes = db[collection].getIndexes(); print("Indexes for " + collection + ":"); pri 阅读全文
posted @ 2024-07-18 18:40 wongchaofan 阅读(4) 评论(0) 推荐(0) 编辑
摘要:要创建单字段索引,请使用以下原型: db.<collection>.createIndex( { <field>: <sortOrder> } ) 复合索引 要创建复合索引,请使用下列 db.collection.createIndex()方法: db.<collection>.createInde 阅读全文
posted @ 2024-07-18 18:21 wongchaofan 阅读(9) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示