persistentCacheIndexManager property

PersistentCacheIndexManager? get persistentCacheIndexManager

The PersistentCacheIndexManager of this instance, or null when it uses a memory cache.

Persistent cache indexes are optional indexes that only exist within the SDK to assist in local query execution; they are not the same as Cloud Firestore indexes.

The getter never throws and keeps returning the same manager after terminate; the methods of that manager then fail with the FirestoreException of a terminated instance.

await firestore.persistentCacheIndexManager?.enableIndexAutoCreation();

Implementation

PersistentCacheIndexManager? get persistentCacheIndexManager {
  if (!client.supportsFieldIndexes) {
    return null;
  }
  return _persistentCacheIndexManager ??=
      PersistentCacheIndexManagerInternal.create(client);
}