Advertisement
Guest User

Untitled

a guest
Aug 13th, 2018
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //First get the list of all documents.
  2.         db.restaurants.find({});
  3.         //Create a variable and assign to a single document id.
  4.         var documentId = ObjectId("59074c7c057aaffaafb0da57");
  5.         //Get the contents of the single document
  6.         db.restaurants.findOne({_id: documentId});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement