Last active
April 17, 2022 18:54
-
-
Save countnazgul/d33533f75b87ebf1df41 to your computer and use it in GitHub Desktop.
[Limit number of returned docs] Limit number of MongoDB query #mongo #mongoose
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Posts | |
.find({}) | |
.sort({}) | |
.limit(5) | |
.exec(function(err, posts) { | |
console.log(posts) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MongoDB