We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c21c601 commit 4cbcb6bCopy full SHA for 4cbcb6b
README.md
@@ -1501,7 +1501,21 @@ db.inventory.find({ pictures: { $exists: true, $ne: [] } })
1501
<b><a href="#">↥ back to top</a></b>
1502
</div>
1503
1504
-#### Q. ***How to get the last N records from find?***
+## Q. ***How to get the last N records from find?***
1505
+
1506
+```js
1507
+// Syntax
1508
+db.<CollectionName>.find().sort({$natural:-1}).limit(value)
1509
1510
1511
+// Example
1512
+db.employee.find().sort({$natural:-1}).limit(100)
1513
+```
1514
1515
+<div align="right">
1516
+ <b><a href="#">↥ back to top</a></b>
1517
+</div>
1518
1519
#### Q. ***Explain relationships in mongodb?***
1520
#### Q. ***What is use of capped collection in MongoDB?***
1521
0 commit comments