Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

findByIdAndUpdate

var user_id = '5eb985d440bd2155e4d788e2';
User.findByIdAndUpdate(user_id, { name: 'Gourav' },
                            function (err, docs) {
    if (err){
        console.log(err)
    }
    else{
        console.log("Updated User : ", docs);
    }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #findByIdAndUpdate
ADD COMMENT
Topic
Name
2+9 =