gpt4 book ai didi

mongodb - 重置 MongoDB oplog

转载 作者:可可西里 更新时间:2023-11-01 10:01:13 25 4
gpt4 key购买 nike

我正在使用 Elastich Search 和 MongoDB 开发一个应用程序。 Elasticsearch 使用 MongoDB oplog 通过称为 river 的组件对内容进行索引。

是否可以重置 MongoDB oplog 以便所有以前的条目都消失?

最佳答案

oplog 用于复制,不应被篡改。

oplog 是一个上限集合:

You cannot delete documents from a capped collection. To remove all records from a capped collection, use the ‘emptycapped’ command. To remove the collection entirely, use the drop() method.

http://docs.mongodb.org/manual/core/capped-collections/

您可能想使用 tailable cursor并在你的河流中追踪 oplog。

关于mongodb - 重置 MongoDB oplog,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17320535/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com