Created
March 3, 2019 11:31
-
-
Save mrlynn/5732309d154bb6becce1f85aff413949 to your computer and use it in GitHub Desktop.
MongoDB Stitch Delete Events Example
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 = 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` }; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?