jsonstore icon indicating copy to clipboard operation
jsonstore copied to clipboard

Support for filter with PUT (to avoid write conflicts)

Open karmakaze opened this issue 7 years ago • 1 comments

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 avatar Aug 06 '18 02:08 karmakaze

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.

karmakaze avatar Aug 06 '18 03:08 karmakaze