Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Get all documents where id is 1234567890
- // Since _id is an Object we need to covert our id into an object before quering
- db.collection('Users').find({_id: new ObjectID(1234567890)}).toArray().then((docs) => {
- console.log('Users');
- console.log(JSON.stringify(docs, undefined, 2));
- }, (err) => {
- console.log('Unable to fetch user', err);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement