function createUser(fbid,name){
    var newUser = new User({
        id:fbid,
        name:name
    });
    return newUser.save()
        .then(doc => doc)
        .catch(err => null);
}
// Create user if user not found in database
Create user if user not found in database
Create user if user not found in database
function createUser(fbid,name){
    var newUser = new User({
        id:fbid,
        name:name
    });
    return newUser.save()
        .then(doc => doc)
        .catch(err => null);
}
function createUser ( fbid , name ) { var newUser = new User ( { id : fbid , name : name } ) ; return newUser . save ( ) . then ( doc => doc ) . catch ( err => null ) ; }
Create user if user not found in database
Create user if user not found in database