MongoDB get executionStats for aggregate query

后端 未结 4 1774
暖寄归人
暖寄归人 2021-02-13 06:23

I am looking for a way to retrieve the executionStats for aggregations.

When using find(), I can retrieve them easily by using explain. Example output:

4条回答
  •  温柔的废话
    2021-02-13 07:17

    I was able to do it in the following way:

    db.myUserCollection.explain("executionStats").aggregate([{$match: {firstName: "John"} }]);
    

    Reference: https://jira.mongodb.org/browse/SERVER-19758

提交回复
热议问题