getDocFromCache
For platforms with offline support, you can set the source
option to control how a get
call uses the offline cache.
By default, a get
call will attempt to fetch the latest document snapshot from your database. On platforms with offline support, the client library will use the offline cache if the network is unavailable or if the request times out.
You can specify the source
option in a get()
call to change the default behavior. You can fetch from only the database and ignore the offline cache, or you can fetch from only the offline cache. For example:
Last updated
Was this helpful?