Last active
October 17, 2019 04:27
-
-
Save luandevpro/7560fde6c7833f1b0922d8c499f8a20a 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('posts') | |
.insertOne({ | |
title: payload.query.title, | |
description: payload.query.description, | |
userId: BSON.ObjectId(payload.query.userId) | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment