gpt4 book ai didi

python - PyMongo Aggregate 如何获取executionStats

转载 作者:行者123 更新时间:2023-12-03 15:59:35 28 4
gpt4 key购买 nike

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

这就是我正在努力做的事情。 how to get Python Mongo Aggregate explain using db.command?

pymongo aggregate don't allow explain option

最佳答案

这对我有用:

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

关于python - PyMongo Aggregate 如何获取executionStats,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56253108/

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