Sort descending on a field.
Section: Projection, sort, and page
Sort newest first
javascript
javascript
db.orders.find().sort({ created_at: -1 })Explanation
`-1` is descending and `1` is ascending.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Projection, sort, and page