Closed mandaputtra closed 4 years ago
@mandaputtra I will review it and get back.
Just for info, I get around this issue with $facet
// assume that page and limit are query params contains number
{
$facet: {
metadata: [{ $count: 'total' }, { $addFields: { page: page } }],
data: [
{ $skip: page === 1 ? 0 : (page - 1) * limit },
{ $limit: limit }
]}
}
@mandaputtra Glad to hear that.
I'll do some test in my free time, and maybe if this was bug ill try to pull request. But that could be a major change. Lest see..
@mandaputtra Appreciate it. You're awesome!
hi ,
i am having the same problem . it always serializes all the docs in the collection one by one not the result in aggregate.
@gezimapi I custom paginate it, with $facet. I wrote an articele here.
It will be a major change if the feature merged,
Thanks @mandaputtra
Just tried this aggregation with,
$unwind
$group
or$facet
it always serializes the docs to be one.