A
A
Alexander risok2021-02-17 17:33:51
MongoDB
Alexander risok, 2021-02-17 17:33:51

How to see the execution time of mongoose aggregate (similar to Query.explain())?

model.collection.aggregate(...).explain is not a function

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuriy Vorobyov, 2021-02-18
@YuriyVorobyov1333

Option 1 - console.time:

console.time('aggregation time');
await model.collection.aggregate(...);
console.timeEnd('aggregation time');

Option 2 is the old explain option: Option 3 is to install the latest version of mongoose and do this ( this is supported):
model.aggregate(..., { explain: true })
model.aggregate(array).explain()

S
Sergey delphinpro, 2017-10-07
_

Mysterious padding of inline elements

Decision
video { display: block; }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question