Answers for "mongodb get first n records"

2

mongodb shell query last document

db.collection.find().limit(1).sort({$natural:-1})
Posted by: Guest on May-12-2020
0

mongodb get first 10 records

#I get the first ten documents from the collection
query = db.collection.find({
      #whatever
  }).limit(10);
Posted by: Guest on February-25-2021

Code answers related to "mongodb get first n records"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language