Skip to content

Instantly share code, notes, and snippets.

@luandevpro
Created October 16, 2019 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luandevpro/ea08a6420a6ae9159c45d5f9b3a1260d to your computer and use it in GitHub Desktop.
Save luandevpro/ea08a6420a6ae9159c45d5f9b3a1260d to your computer and use it in GitHub Desktop.
exports = function(payload, response) {
const atlas = context.services.get('mongodb-atlas');
return atlas
.db('apitutorial')
.collection('users')
.findOne({ _id: BSON.ObjectId(payload.query.id) });
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment