Last active
October 17, 2019 03:19
-
-
Save luandevpro/49a4ae43a1889fc5357dce02b357ccdf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports = function(payload, response) { | |
const atlas = context.services.get('mongodb-atlas'); | |
return atlas | |
.db('apitutorial') | |
.collection('users') | |
.findOneAndUpdate( | |
{ _id: BSON.ObjectId(payload.query.id) }, | |
{ | |
$set: { | |
email: payload.query.email, | |
age: payload.query.age, | |
name: payload.query.name, | |
password: payload.query.password, | |
}, | |
} | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment