Tsallaka zuwa abun ciki
Justice Tech School

sort, limit and skip

Order and page results.

Example
db.users.find().sort({ age: -1 }).limit(5)
db.users.find().skip(10).limit(10)

Exercise

Descending.

sort({ age:  })

Quiz Test

What does 1 mean in sort?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.