INNER CODE UNIT · JavaScript
update
mongoist/mongoist · lib/bulk.js:50
const update = (u, multi) => {
const cmd = this.ensureCommand('update', 'updates');
cmd.updates.push({ q, u, multi, upsert })
}
return new FindSyntax({
update,
upsert(upsertValue) { upsert = upsertValue },
remove
});
}
insert(doc) {
const cmd = this.ensureCommand('insert', 'documents');
doc._id = doc._id || oid();
cmd.documents.push(doc);
}