日期:2014-05-16  浏览次数:20389 次

MongoDB - 索引 (二)使用
索引相关操作


Name Description
db.collection.createIndex() Builds an index on a collection. Use db.collection.ensureIndex().
db.collection.dropIndex() Removes a specified index on a collection.
db.collection.dropIndexes() Removes all indexes on a collection.
db.collection.ensureIndex() Creates an index if it does not currently exist. If the index existsensureIndex() does nothing.
db.collection.getIndexes()