firestore

firestore(app) returns Object

Gets the Firestore client for the current app.

admin.firestore() can be called with no arguments to access the default app's Firestore client or as admin.firestore(app) to access the Firestore client associated with a specific app.

Parameter

app

Optional

admin.app.App

An optional app whose Firestore client to return. If not provided, the default app's Firestore client will be returned.

Value must not be null.

Returns

non-null Object The default Firestore client if no app is provided or the Firestore client associated with the provided app.

Examples

// Get the Firestore client for the default app
var defaultFirestore = admin.firestore();
// Get the Firestore client for a given app
var otherFirestore = admin.firestore(otherApp);

Classes

Interfaces