MongoDB学习记录—索引

1. 索引

1.1 添加索引

db.CollectionName.ensureIndex({"字段列名":1})  其中1为正序 -1为倒序

1.2 查询索引

db.CollectionName.getIndexes()

1.3 删除索引

db.CollectionName.dropIndex({"字段列名":1})


猜你喜欢

转载自blog.csdn.net/FormatWindowsXP/article/details/51753526