Skip to content

Instantly share code, notes, and snippets.

@luandevpro
Created October 17, 2019 04:02
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/ca9a9b1aafe625576a3375b114fa1c4a to your computer and use it in GitHub Desktop.
Save luandevpro/ca9a9b1aafe625576a3375b114fa1c4a 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('posts')
.insertOne({
title: payload.query.title,
description: payload.query.description,
userId: payload.query.userId
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment