您的位置:首页 > 博客中心 > 数据库 >

mongoDB index

时间:2022-03-14 00:31

1. create index

db.students.ensureIndex({class:1,student_name:1})

 http://docs.mongodb.org/manual/tutorial/create-an-index/

2. show all indexes in current DB

db.system.indexes.find()

 3. show index for a collection

db.grades.getIndexes()

 4. delete index

db.grades.dropIndex({"student_id":1})

 

热门排行

今日推荐

热门手游