Skip to content

Instantly share code, notes, and snippets.

@brunokrebs
Created October 30, 2017 11:17
Show Gist options
  • Save brunokrebs/3d9a2a471ca10166dbb5d9ef1825b9a8 to your computer and use it in GitHub Desktop.
Save brunokrebs/3d9a2a471ca10166dbb5d9ef1825b9a8 to your computer and use it in GitHub Desktop.
Webtask and MongoDB
var parallel = require('async').parallel;
var MongoClient = require('[email protected]').MongoClient;
module.exports = function (ctx, done) {
var url = 'mongodb://bkrebs:[email protected]:23410/brunokrebsauth0'
MongoClient.connect(url, function (err, db) {
if(err) return done(err);
db.collection('test').insertOne({
name: 'Bruno [email protected]',
time: new Date()
}, done);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment