[cloud_firestore] it should be possible to set GetOptions for query.snapshots() #4755
Unanswered
KristianBalaj
asked this question in
Feature request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Let's have a query like this:
It is possible to set
GetOptions
when usingquery.get()
method.The problem is that we cannot set the
GetOptions
when usingquery.snapshots()
.In our current example we would like to set it only to
Source.server
so we would not take data in the cache into account.It is doing anomalies and wrong results in the data when fetching from cache.
Current behaviour of
.snapshots()
Let's have these documents displayed as tuples (name, is in cache).
When executing the previous query with
.snapshots()
in case of ordering by the name (first item in the tuple), the first snapshot that comes in isA, B, C, D, F
. After that comes another snapshot that removes theF
and adds theE
.This is bad because the correct result should be without the
F
and withE
like this -A, B, C, D, E
.Proposed behaviour
It should be possible to set
GetOptions
in the.snapshots()
just like inget([GetOptions options])
, so in case of valueSource.server
the query would ignore the cache.Current workaround
As the initial query we do the
get()
withSource.server
and after that we listen for changes with the.snapshots()
.This is not that convenient.
Or to disable caching all along is another possible solution.
Beta Was this translation helpful? Give feedback.
All reactions