Update 'README.md'
This commit is contained in:
parent
e3c43a68f7
commit
33de67c5ea
@ -300,9 +300,9 @@ Returns:
|
|||||||
```
|
```
|
||||||
|
|
||||||
## .limit(), .skip() and .sort()
|
## .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/)
|
[More SQL vs Mongo comparisons](https://docs.mongodb.com/manual/reference/sql-aggregation-comparison/)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user