gpt4 book ai didi

mongodb - 在哪里可以找到 Mongodb 中执行的 DDL 命令

转载 作者:IT老高 更新时间:2023-10-28 13:30:07 27 4
gpt4 key购买 nike

我想知道通过 TTL 索引删除的文档的日志。我尝试使用 db.setProfileLevel(2) 并搜索 db.system.profile.find({op:"remove"}).pretty(),但它返回什么都没有。

您能否告诉我使用 TTL MongoDB 功能自动删除的文档的位置(类型 IDs 等)?

最佳答案

来自手册 Expire Data from Collections by Setting TTL

When the TTL thread is active, you will see a delete operation in the output of db.currentOp() or in the data collected by the database profiler.

所以尝试在查询中使用 delete 而不是 remove

关于mongodb - 在哪里可以找到 Mongodb 中执行的 DDL 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28736688/

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