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

Support upserts #84

Open
mattmccutchen opened this issue Feb 11, 2017 · 0 comments
Open

Support upserts #84

mattmccutchen opened this issue Feb 11, 2017 · 0 comments

Comments

@mattmccutchen
Copy link
Collaborator

This package could support upserts. Starting an issue thread to collect information.

As per my remarks here, if we're willing to represent an upsert in the history as either an insert or an update, then it's pretty straightforward to emulate the upsert by checking for an existing document and deciding whether to insert or update. The only tricky part is constructing the document to insert from the selector and the modifier. Meteor has two implementations of this (1, 2) that we can copy.

If we want to represent an upsert in the history as its own action type so it can be redone as an upsert, then it becomes more complicated to decide on and implement the undo and redo behavior.

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