-
-
Save c0nrad/beb9dd7413b5b3438c94d83160bffefd 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 {db, collection} = payload.query; | |
const body = EJSON.parse(payload.body.text()) | |
console.log("db, collection: ", db, collection); | |
console.log("Request body:", body); | |
body.ts = new Date(body.ts) | |
context.services.get("mongodb-atlas").db(db).collection(collection).insertOne(body) | |
return "{'msg':'keep the change you filthy animal'}"; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment