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

浏览:58日期:2023-06-14

问题描述

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

问题解答

回答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日,请戳:>---<

相关文章: