Open indo-dev-0 opened 5 years ago
It would be nice if I could just pass in a document and not worry about the update function: db.upsert(docId, diffFunc|doc [, callback]). I usually just want to overwrite the old document and this would be a nice ergonomic enhancement:
db.upsert(docId, diffFunc|doc [, callback])
let doc = {id: "12345", foo: "baz"}; db.upsert(doc.id, (old) => { return doc; }); //vs db.upsert(doc.id, doc);
It would be nice if I could just pass in a document and not worry about the update function:
db.upsert(docId, diffFunc|doc [, callback])
. I usually just want to overwrite the old document and this would be a nice ergonomic enhancement: