Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //First get the list of all documents.
- db.restaurants.find({});
- //Create a variable and assign to a single document id.
- var documentId = ObjectId("59074c7c057aaffaafb0da57");
- //Get the contents of the single document
- db.restaurants.findOne({_id: documentId});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement