From 33de67c5eab3171fd264d1020b131cc85b5627f3 Mon Sep 17 00:00:00 2001 From: Franco Colmenarez Date: Thu, 16 Sep 2021 22:31:33 +0000 Subject: [PATCH] Update 'README.md' --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d242bd7..f6cc261 100644 --- a/README.md +++ b/README.md @@ -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/)