How to update mongodb collection from JS?
db.collection('fruits', function (err, collection) {
collection.update({ "_id": content.fruitID}, content, function () {
});
});
Am I doing it right? Do I need to use $ set?
Basically, content is a json object that should replace the found document.
Thank.
I am using my own mongodb node driver.
source
share