DEV Community

Discussion on: The right way to make advanced and efficient MongoDB pagination

Collapse
 
dhensen profile image
Dino Hensen

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.