Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. // Get all documents where id is 1234567890
  2. // Since _id is an Object we need to covert our id into an object before quering
  3. db.collection('Users').find({_id: new ObjectID(1234567890)}).toArray().then((docs) => {
  4. console.log('Users');
  5. console.log(JSON.stringify(docs, undefined, 2));
  6. }, (err) => {
  7. console.log('Unable to fetch user', err);
  8. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement