getDatabase method

Database getDatabase([
  1. App app
])

Gets the {@link Database} service for the default app or a given app.

getDatabase() can be called with no arguments to access the default app's Database service or as getDatabase(app) to access the Database service associated with a specific app.

@example

// Get the Database service for the default app
const defaultDatabase = getDatabase();

@example

// Get the Database service for a specific app
const otherDatabase = getDatabase(app);

@param App - whose Database service to return. If not provided, the default Database service will be returned.

@returns The default Database service if no app is provided or the Database service associated with the provided app.

Implementation

external Database getDatabase([App app]);