explain

mongodb explain agregation Использование с агрегацией пример

Можно так:

db.report.explain("allPlansExecution").aggregate(
[......пайплайн...],
{"allowDiskUse":true,
"cursor":{"batchSize":50000}}).explain('executionStats')

где report -- имя коллекции.


Источники:

  1. Ещё вариант: https://stackoverflow.com/questions/1270...

mongodb Failed to execute script explain is not a function -- ошибка в агрегации

Failed to execute script.
Error:
TypeError: db.....aggregate(...).explain is not a function :
@(shell):1:1

-- ошибка связана с попыткой использовать explain так:

db.following_report.aggregate(
[......пайплайн...],
{"allowDiskUse":true,
"cursor":{"batchSize":50000}}).explain('executionStats')

Решение

Используйте explain правильно.

Subscribe to RSS - explain