backendFirestoreDatabaseId property

String? get backendFirestoreDatabaseId

The Firestore database id the app connects to.

null (the default) targets Firestore's conventional (default) database, so existing apps are unaffected. Set this to a NAMED database id (e.g. 'default') for projects whose Firestore is an Enterprise-edition database — Enterprise databases cannot use the (default) id, so the SDK must target the named database explicitly.

Set via --dart-define=BACKEND_FIRESTORE_DATABASE_ID=default or programmatically via backendFirestoreDatabaseIdDefault. Consumed by firestore.

Implementation

static String? get backendFirestoreDatabaseId {
  if (!_backendFirestoreDatabaseIdResolved) {
    const envValue = String.fromEnvironment('BACKEND_FIRESTORE_DATABASE_ID');
    _backendFirestoreDatabaseId =
        envValue.isNotEmpty ? envValue : _backendFirestoreDatabaseIdDefault;
    _backendFirestoreDatabaseIdResolved = true;
  }
  return _backendFirestoreDatabaseId;
}