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

Replace document functionality #280

Open
theodorDiaconu opened this issue Apr 23, 2018 · 1 comment
Open

Replace document functionality #280

theodorDiaconu opened this issue Apr 23, 2018 · 1 comment

Comments

@theodorDiaconu
Copy link
Contributor

https://docs.mongodb.com/manual/reference/method/db.collection.update/#replace-a-document-entirely

// fully override the doc
Collection.update(id, { a: 10, b: 5 })
@theodorDiaconu
Copy link
Contributor Author

The replacement should be detected when we perform the update.
We create a new event type:
Event.IS_REPLACEMENT = 'ir'

We only send this event, alongside an update when this is detected.

Create a new method in ObservableCollection, replace(docId, newDocument), this will be similar to update() so we need to re-use some stuff from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant