Answers for "$set"

0

$set

// https://mongodb.github.io/node-mongodb-native/markdown-docs/insert.html

//To update only selected fields, $set operator needs to be used. Following replacement object replaces author value but leaves everything else intact.

collection.update({_id:"123"}, {$set: {author:"Jessica"}});
Posted by: Guest on July-28-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language