mongodb 索引
2016-02-02 11:39
399 查看
mongodb的索引的创建方法;
db.collection.ensureIndex(keys,options) 在mongodb3.0版本后被弃用。
现在是db.collection.createIndex()的别名
db.colleciton.getIndexes()得到collection的所有的索引 () 只能在3.0版本用
For MongoDB 3.0 deployments using the WiredTiger storage
engine, if you rundb.collection.getIndexes() from a version of the mongo shell
before 3.0 or a version of the driver prior to 3.0
compatible version, db.collection.getIndexes() will
return no data, even if there are existing indexes. For more information, see WiredTiger
and Driver Version Compatibility.
得到collection的所有索引:
To return a list of all indexes on all collections in a database, usethe following operation in the
mongo shell:
db.collection.ensureIndex(keys,options) 在mongodb3.0版本后被弃用。
现在是db.collection.createIndex()的别名
db.colleciton.getIndexes()得到collection的所有的索引 () 只能在3.0版本用
For MongoDB 3.0 deployments using the WiredTiger storage
engine, if you rundb.collection.getIndexes() from a version of the mongo shell
before 3.0 or a version of the driver prior to 3.0
compatible version, db.collection.getIndexes() will
return no data, even if there are existing indexes. For more information, see WiredTiger
and Driver Version Compatibility.
得到collection的所有索引:
db.people.getIndexes()
To return a list of all indexes on all collections in a database, usethe following operation in the
mongo shell:
db.system.indexes.find()
相关文章推荐
- windows下mongodb安装与使用整理
- Java程序员在用的大数据工具,MongoDB稳居第一!
- mongodb 对地理位置坐标的计算
- MongoDB 查询文档
- mongodb php auto increment 自增
- mongodb group php 操作
- MongoDB 删除文档
- MongoDB 更新文档
- MongoDB 插入文档
- mongodb select php操作 命令行操作
- MongoDB 删除数据库
- MongoDB 创建数据库
- MongoDB - 连接
- MongoDB 概念解析
- window平台安装 MongoDB(二)
- MongoDB入门学习(1)
- MongoDB_条件操作符
- mongodb 3.0 使用mongodump、mongorestore数据迁移
- 用“MEAN”技术栈开发web应用(三)用mongodb搭建数据库
- 用“MEAN”技术栈开发web应用(三)用mongodb搭建数据库