Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Support for filter with PUT (to avoid write conflicts) #38

Open
karmakaze opened this issue Aug 6, 2018 · 1 comment
Open

Support for filter with PUT (to avoid write conflicts) #38

karmakaze opened this issue Aug 6, 2018 · 1 comment

Comments

@karmakaze
Copy link

If the JSON contains a version field, then it would be possible to prevent accidental overwrites by having each writer pass in the version it's updating. The first would succeed and the second would get an status indicating that the write failed due to the 'optimistic version lock', at which point the operation would be retried by first re-reading the current version.

Another approach which could be better in some cases is support for PATCH where incremental addition/update/delete could be made to a document.

@karmakaze
Copy link
Author

Found that mixing short and long paths effectively PATCH the document of the main hash. This wasn't obvious from the README if not already familiar with Firebase. The filtered PUT is still good to have.

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

No branches or pull requests

1 participant