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 правильно.