发布于 2015-09-14 15:12:09 | 125 次阅读 | 评论: 0 | 来源: 网络整理

db.collection.createIndex(keys, options)

1.8 版后已移除.

参数:
  • keys (document) – A document that contains pairs with the name of the field or fields to index and order of the index. A 1 specifies ascending and a -1 specifies descending.
  • options (document) – A document that controls the creation of the index. This argument is optional.

The ensureIndex() method is the preferred way to create indexes on collections.

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务