Closed satish-baghel closed 3 years ago
i got this issue too i try several time and find my solution
you shouldn't await aggregate function make it pipeline and your result will come out
module.exports.aggregate = async ( aggregate ) => { const aggregateModel = mongoModel.aggregate(aggregate); // dont await here const paginate = await mongoModel.aggregatePaginate(aggregateModel,); return aggregateModel; };
here my code hope it'll help you
i got this issue too i try several time and find my solution
you shouldn't await aggregate function make it pipeline and your result will come out
module.exports.aggregate = async ( aggregate ) => { const aggregateModel = mongoModel.aggregate(aggregate); // dont await here const paginate = await mongoModel.aggregatePaginate(aggregateModel,); return aggregateModel; };
here my code hope it'll help you
Awesome!!, Works for me. Thank you.