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

reIndex

The reIndex command rebuilds all indexes for a specified collection. Use the following syntax:

{ reIndex: "collection" }

Normally, MongoDB compacts indexes during routine updates. For most users, the reIndex command is unnecessary. However, it may be worth running if the collection size has changed significantly or if the indexes are consuming a disproportionate amount of disk space.

Call reIndex using the following form:

db.collection.reIndex();

警告

This command obtains a write lock on the affected database and will block other operations until it has completed.

注解

For replica sets, reIndex will not propagate from the primary to secondaries. reIndex will only affect a single mongod instance.

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

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