Update 'README.md'

This commit is contained in:
Franco Colmenarez 2021-09-16 22:31:33 +00:00
parent e3c43a68f7
commit 33de67c5ea

View File

@ -300,9 +300,9 @@ Returns:
```
## .limit(), .skip() and .sort()
This doesn't need that much explanation, it works similar to SQL's LIMIT, OFFSET and ORDER BY
This doesn't need that much explanation, it works similar to SQL's LIMIT, OFFSET and ORDER BY. In the order, negative numbers (`-1`) are for descending order and positive numbers (`1`) for ascending order.
```
> db.pokemons.find({}).limit(10).skip(10).sort({pokedexId: "desc"})
> db.pokemons.find({}).limit(10).skip(10).sort({pokedexId: -1, name: 1})
```
[More SQL vs Mongo comparisons](https://docs.mongodb.com/manual/reference/sql-aggregation-comparison/)