Thursday, 27 April 2017

Best way to insert data in mongoDB using node.js?

I have the following code:

app.post('/api/sign-up', function(req,res,next){
firebase.auth().createUserWithEmailAndPassword(req.body.email, req.body.password).then(function (user) {
console.log('new user has signed up! their e-mail address: '+user.email+' | User ID: '+user.uid)

    db.getCollection('Users').insert({
'ID': user.uid
'E-mail address': user.email
'Source': req.body.source
 // 'Country': based on IP
})

What node module should I use for the above db.getcoll.insert command?



via huzal12

No comments:

Post a Comment