External API Re-exports
The following externally defined APIs are re-exported from this module entry point for convenience.
| Symbol | Description | 
|---|---|
| BulkWriter | BulkWritertype from the@google-cloud/firestorepackage. | 
| AggregateField | AggregateFieldtype from the@google-cloud/firestorepackage. | 
| BulkWriterOptions | BulkWriterOptionstype from the@google-cloud/firestorepackage. | 
| BundleBuilder | BundleBuildertype from the@google-cloud/firestorepackage. | 
| CollectionGroup | CollectionGrouptype from the@google-cloud/firestorepackage. | 
| CollectionReference | CollectionReferencetype from the@google-cloud/firestorepackage. | 
| DocumentChange | DocumentChangetype from the@google-cloud/firestorepackage. | 
| DocumentData | DocumentDatatype from the@google-cloud/firestorepackage. | 
| DocumentReference | DocumentReferencetype from the@google-cloud/firestorepackage. | 
| DocumentSnapshot | DocumentSnapshottype from the@google-cloud/firestorepackage. | 
| FieldPath | FieldPathtype from the@google-cloud/firestorepackage. | 
| FieldValue | FieldValuetype from the@google-cloud/firestorepackage. | 
| Filter | Filtertype from the@google-cloud/firestorepackage. | 
| Firestore | Firestoretype from the@google-cloud/firestorepackage. | 
| FirestoreDataConverter | FirestoreDataConvertertype from the@google-cloud/firestorepackage. | 
| GeoPoint | GeoPointtype from the@google-cloud/firestorepackage. | 
| GrpcStatus | GrpcStatustype from the@google-cloud/firestorepackage. | 
| Precondition | Preconditiontype from the@google-cloud/firestorepackage. | 
| Query | Querytype from the@google-cloud/firestorepackage. | 
| QueryDocumentSnapshot | QueryDocumentSnapshottype from the@google-cloud/firestorepackage. | 
| QueryPartition | QueryPartitiontype from the@google-cloud/firestorepackage. | 
| QuerySnapshot | QuerySnapshottype from the@google-cloud/firestorepackage. | 
| ReadOptions | ReadOptionstype from the@google-cloud/firestorepackage. | 
| SetOptions | SetOptionstype from the@google-cloud/firestorepackage. | 
| Timestamp | Timestamptype from the@google-cloud/firestorepackage. | 
| Transaction | Transactiontype from the@google-cloud/firestorepackage. | 
| WriteBatch | WriteBatchtype from the@google-cloud/firestorepackage. | 
| WriteResult | WriteResulttype from the@google-cloud/firestorepackage. | 
| setLogFunction | setLogFunctionfunction from the@google-cloud/firestorepackage. | 
Cloud Firestore.
Functions
| Function | Description | 
|---|---|
| getFirestore() | Gets the default Firestore service for the default app. | 
| getFirestore(app) | Gets the default Firestore service for the given app. | 
| getFirestore(databaseId) | (BETA) Gets the named Firestore service for the default app. | 
| getFirestore(app, databaseId) | (BETA) Gets the named Firestore service for the given app. | 
| initializeFirestore(app, settings) | Gets the default Firestore service for the given app, passing extra parameters to its constructor. | 
| initializeFirestore(app, settings, databaseId) | (BETA) Gets the named Firestore service for the given app, passing extra parameters to its constructor. | 
Classes
| Class | Description | 
|---|---|
| FirebaseFirestoreError | Firebase Firestore error code structure. This extends FirebaseError. | 
Interfaces
| Interface | Description | 
|---|---|
| FirestoreSettings | Settings to pass to the Firestore constructor. | 
getFirestore()
Gets the default Firestore service for the default app.
Signature:
export declare function getFirestore(): Firestore;
Returns:
Firestore
The default Firestore service for the default app.
Example
// Get the default Firestore service for the default app
const defaultFirestore = getFirestore();
getFirestore(app)
Gets the default Firestore service for the given app.
Signature:
export declare function getFirestore(app: App): Firestore;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| app | App | which Firestoreservice to return. | 
Returns:
Firestore
The default Firestore service associated with the provided app.
Example
// Get the default Firestore service for a specific app
const otherFirestore = getFirestore(app);
getFirestore(databaseId)
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Gets the named Firestore service for the default app.
Signature:
export declare function getFirestore(databaseId: string): Firestore;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| databaseId | string | name of database to return. | 
Returns:
Firestore
The named Firestore service for the default app.
Example
// Get the Firestore service for a named database and default app
const otherFirestore = getFirestore('otherDb');
getFirestore(app, databaseId)
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Gets the named Firestore service for the given app.
Signature:
export declare function getFirestore(app: App, databaseId: string): Firestore;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| app | App | which Firestoreservice to return. | 
| databaseId | string | name of database to return. | 
Returns:
Firestore
The named Firestore service associated with the provided app.
Example
// Get the Firestore service for a named database and specific app.
const otherFirestore = getFirestore('otherDb');
initializeFirestore(app, settings)
Gets the default Firestore service for the given app, passing extra parameters to its constructor.
Signature:
export declare function initializeFirestore(app: App, settings?: FirestoreSettings): Firestore;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| app | App | which Firestoreservice to return. | 
| settings | FirestoreSettings | Settings object to be passed to the constructor. | 
Returns:
Firestore
The default Firestore service associated with the provided app and settings.
Example
// Get the Firestore service for a specific app, require HTTP/1.1 REST transport
const otherFirestore = initializeFirestore(app, {preferRest: true});
initializeFirestore(app, settings, databaseId)
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Gets the named Firestore service for the given app, passing extra parameters to its constructor.
Signature:
export declare function initializeFirestore(app: App, settings: FirestoreSettings, databaseId: string): Firestore;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| app | App | which Firestoreservice to return. | 
| settings | FirestoreSettings | Settings object to be passed to the constructor. | 
| databaseId | string | name of database to return. | 
Returns:
Firestore
The named Firestore service associated with the provided app and settings.
Example
// Get the Firestore service for a specific app, require HTTP/1.1 REST transport
const otherFirestore = initializeFirestore(app, {preferRest: true}, 'otherDb');