Reputation: 149
Server mongo version is 3.4.4. Connected by Studio 3T. When I query like this in IntelliShell
db.orders.aggregate([
{ $limit: 10 },
{ $skip: 10 }
])
I get nothing returned.
However, when I switch the $limit and $skip,
db.orders.aggregate([
{ $skip: 10 },
{ $limit: 10 }
])
It works fine.
Upvotes: 0
Views: 199
Reputation: 149
This is my understanding:
The $limit: 10
means 'I want ten result',
and the $skip
means 'I don't need the first tens'.
So, I get 0 results by the first query, get 10-20 results by the second query.
Upvotes: 1