Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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` };
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.