Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upsert without update function #64

Open
indo-dev-0 opened this issue Jul 26, 2019 · 0 comments
Open

Upsert without update function #64

indo-dev-0 opened this issue Jul 26, 2019 · 0 comments

Comments

@indo-dev-0
Copy link

indo-dev-0 commented Jul 26, 2019

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:

let doc = {id: "12345", foo: "baz"};
db.upsert(doc.id, (old) => {
  return doc;
});
//vs
db.upsert(doc.id, doc);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant