console.time('aggregation time');
await model.collection.aggregate(...);
console.timeEnd('aggregation time');
model.aggregate(..., { explain: true })
model.aggregate(array).explain()
const mongoose = require('mongoose');
const firstConnection = mongoose.createConnection('опции для подключения')
const secondfirstConnection = mongoose.createConnection('опции для подключения')