P
P
philatov1822020-04-29 10:23:59
MongoDB
philatov182, 2020-04-29 10:23:59

How to find out the execution time of an aggregation query at the mongoose db level?

I am writing a query that groups data through Mongoose, how can I find out the query execution time at the database level?

Student.aggregate([
{$lookup:{
from:"groups",
localField:"group",
foreignField:"_id",
as: "group"
}},
{$unwind: "$group"},
{$group: { _id: {groupnum:"$group.num", passnum:"$passport.num"}, count:{$sum:1} }}
])

.explain("executionStats") doesn't work

here to learn time of performance of this request?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question