Can you please explain why you named the count field $count: 'createdAt'? It seems to me it might as well could be named foobar and still yield the same result or am I missing something?
I also do not understand that last $unwind: '$total'
This article has helped me a lot as somebody with minimum mongo experience in building a facet based pagination instead of skip-limit or keyset pagination.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Can you please explain why you named the count field
$count: 'createdAt'
? It seems to me it might as well could be namedfoobar
and still yield the same result or am I missing something?I also do not understand that last
$unwind: '$total'
This article has helped me a lot as somebody with minimum mongo experience in building a facet based pagination instead of skip-limit or keyset pagination.