mongodb聚合怎么查看查询性能?

用find可以使用explain('executionStats')查看查询分析,但是aggregate用没有explain查询分析了,根本看不出它有没有用索引,是否在内存排序这些问题啊...

阅读 7.8k
1 个回答

不妨多看看官方文档吧。

https://docs.mongodb.com/manu...

db.collection.aggregate(pipeline, options)

The options document can contain the following fields and values:explain,allowDiskUse,etc.

Love MongoDB! Have Fun!


MongoDB在线讲座系列19- MongoDB 10步构建单一视图

就在4月19日,请戳:>---<

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进