You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
update/upsert: _id is generated even if you send a pre-generated _id the json object #39
Consider this lines of code with an empty db file:
[...]
//I need to pre-generate the _id of this object and not use a auto-generated _id
var obj = {
"_id": "xxxxxxx",
"name": "test"
};
console.log("Before: ", obj);
db.records.update({ _id : "xxxxxxx" }, obj, {multi: false, upsert: true});
console.log("After: ", obj);
[...]
Activity