Skip to content

Instantly share code, notes, and snippets.

@mrlynn
Created March 3, 2019 11:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrlynn/5732309d154bb6becce1f85aff413949 to your computer and use it in GitHub Desktop.
Save mrlynn/5732309d154bb6becce1f85aff413949 to your computer and use it in GitHub Desktop.
MongoDB Stitch Delete Events Example
exports = async function(payload) {
const mongodb = context.services.get("mongodb-atlas");
const eventsdb = mongodb.db("events");
const eventscoll = eventsdb.collection("events");
const delresult = await eventscoll.deleteOne({name:payload.query.name, location: payload.query.location});
return { text: `Deleted ${delresult.deletedCount} items` };
};
@sielski666
Copy link

Just a quick question from someone who’s learning code; does this part “ name:payload.query.name,” referenced to what it’s called in the mongodb and then what it’s called in sheets?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment