How do I update a mongodb collection from JS?
db.collection('fruits', function (err, collection) {
collection.update({ "_id": content.fruitID}, content, function () {
});
});
Am I doing this right? DO I need to use $set?
Basically content is a json object that should replace the document that's found.
Thanks.
I'm using the mongodb node native driver.