Abstract types




An approximate cache size threshold for the on-disk data. If the cache grows beyond this size, Firestore will start removing data that hasn't been recently used. The size is not a guarantee that the cache will stay below that size, only that if the cache exceeds the given size, cleanup will be attempted.

The default value is 40 MB. The threshold must be set to at least 1 MB, and can be set to CACHE_SIZE_UNLIMITED to disable garbage collection.




Enables the use of Timestamps for timestamp fields in DocumentSnapshots.

Currently, Firestore returns timestamp fields as Date but Date only supports millisecond precision, which leads to truncation and causes unexpected behavior when using a timestamp from a snapshot as a part of a subsequent query.

Setting timestampsInSnapshots to true will cause Firestore to return Timestamp values instead of Date, which avoids truncation. Note that you must also change any code that uses Date to use Timestamp instead.

WARNING: In the future, timestampsInSnapshots: true will become the default and this option will be removed. You should change your code to use Timestamp and opt-in to this new behavior as soon as you can.