解释(“ executionStats”)与总不能在猫鼬工作

时间:2019-04-29 05:06:16

标签: mongoose

要在猫鼬5.5.4(当前最新版本)中测试聚合查询的性能,请致电

User.explain("executionStats").aggregate([]);

它意外地调用“ User.explain不是一个函数”错误,因为它在mongodb shell中具有这些结果。

db.getCollection('users').explain("allPlansExecution").aggregate([
    {$match: {"categories.dotoris._id": ObjectId("5cbfbdd5a23e14127c603a1a")}},
    {$project:{_id:1, "categories._id":1, "categories.dotoris":1}}])
  

结果   enter image description here


搜索猫鼬文档后,发现可以使用以下功能

User.aggregate([]).explain("executionStats")

但是它只有queryPlanner信息,但具有执行状态。

如何获得以猫鼬为单位的执行状态信息?

0 个答案:

没有答案
相关问题