-
Notifications
You must be signed in to change notification settings - Fork 344
Closed
Description
As discussed in #54, I think it would be a good idea of exposing API functions that can explicitly access the value of the ETag of the firebase db.
We could have the following API for the Reference class:
get(self, etag=False) # When etag is True, behaves like _get_with_etag()
set(self, value, etag=None) # When etag is not None, behaves like _update_with_etag()
get_etag(self) # Retrieves the etag without the corresponding data
check_etag(self, etag) # Returns a boolean indicating whether or not the etag is correct
These API functions could come in handy for low level operations that the user may want to perform that the proposed transaction functionality may not be able to handle. An example would be if the user keeps a cache of some of the firebase data, the user will likely want to keep track of the ETag for each part of the database, so he can check whether the data in some part of the cache is up to date.