【问题标题】:PyMongo Aggregate how to get executionStatsPyMongo Aggregate 如何获取 executionStats
【发布时间】:2019-10-08 17:20:59
【问题描述】:

我正在尝试获取特定 mongo 聚合查询的 executionStats。我运行 db.command 但没有给出“执行状态”

这就是我想要做的。 how to get Python Mongo Aggregate explain using db.command?

pymongo aggregate don't allow explain option

【问题讨论】:

  • PyMongo 和 MongoDB 哪个版本?

标签: python mongodb aggregation-framework pymongo


【解决方案1】:

这对我有用:

db.command('explain', {'aggregate': coll_name, 'pipeline': you_pipeline, 'cursor': {}}, verbosity='executionStats')

【讨论】:

    猜你喜欢
    • 2017-02-16
    • 1970-01-01
    • 2020-04-29
    • 1970-01-01
    • 2016-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多