firebase-admin.firestore package

外部 API の再エクスポート

外部で定義された次の API は、このモジュールのエントリ ポイントから再エクスポートされています。

記号 説明
BulkWriter @google-cloud/firestore パッケージの BulkWriter 型。
AggregateField @google-cloud/firestore パッケージの AggregateField 型。
BulkWriterOptions @google-cloud/firestore パッケージの BulkWriterOptions 型。
BundleBuilder @google-cloud/firestore パッケージの BundleBuilder 型。
コレクション グループ @google-cloud/firestore パッケージの CollectionGroup 型。
CollectionReference @google-cloud/firestore パッケージの CollectionReference 型。
ドキュメントの変更 @google-cloud/firestore パッケージの DocumentChange 型。
DocumentData @google-cloud/firestore パッケージの DocumentData 型。
ドキュメント参照 @google-cloud/firestore パッケージの DocumentReference 型。
DocumentSnapshot @google-cloud/firestore パッケージの DocumentSnapshot 型。
FieldPath @google-cloud/firestore パッケージの FieldPath 型。
FieldValue @google-cloud/firestore パッケージの FieldValue 型。
フィルタ @google-cloud/firestore パッケージの Filter 型。
Firestore @google-cloud/firestore パッケージの Firestore 型。
FirestoreDataConverter @google-cloud/firestore パッケージの FirestoreDataConverter 型。
GeoPoint @google-cloud/firestore パッケージの GeoPoint 型。
GrpcStatus @google-cloud/firestore パッケージの GrpcStatus 型。
前提条件 @google-cloud/firestore パッケージの Precondition 型。
クエリ @google-cloud/firestore パッケージの Query 型。
QueryDocumentSnapshot @google-cloud/firestore パッケージの QueryDocumentSnapshot 型。
QueryPartition @google-cloud/firestore パッケージの QueryPartition 型。
クエリ スナップショット @google-cloud/firestore パッケージの QuerySnapshot 型。
ReadOptions @google-cloud/firestore パッケージの ReadOptions 型。
SetOptions @google-cloud/firestore パッケージの SetOptions 型。
タイムスタンプ @google-cloud/firestore パッケージの Timestamp 型。
Transaction @google-cloud/firestore パッケージの Transaction 型。
WriteBatch @google-cloud/firestore パッケージの WriteBatch 型。
WriteResult @google-cloud/firestore パッケージの WriteResult 型。
setLogFunction @google-cloud/firestore パッケージの setLogFunction 関数。

Cloud Firestore

関数

関数 説明
getFirestore() デフォルト アプリ用のデフォルトの Firestore サービスを取得します。
getFirestore(app) 指定したアプリのデフォルトの Firestore サービスを取得します。
getFirestore(databaseId) (ベータ版)デフォルト アプリ用の名前付き Firestore サービスを取得します。
getFirestore(app, databaseId) (ベータ版)特定のアプリの名前付き Firestore サービスを取得します。
InitializeFirestore(app, settings) 指定されたアプリのデフォルトの Firestore サービスを取得し、追加のパラメータをそのコンストラクタに渡します。
初期化 Firestore(app, settings, databaseId) (ベータ版)特定のアプリの名前付き Firestore サービスを取得し、追加のパラメータをそのコンストラクタに渡します。

インターフェース

インターフェース 説明
FirestoreSettings Firestore コンストラクタに渡す設定。

getFirestore()

デフォルト アプリ用のデフォルトの Firestore サービスを取得します。

署名:

export declare function getFirestore(): Firestore;

戻り値:

Firestore

デフォルト アプリ用のデフォルトの Firestore サービス。

// Get the default Firestore service for the default app
const defaultFirestore = getFirestore();

getFirestore(アプリ)

指定したアプリのデフォルトの Firestore サービスを取得します。

署名:

export declare function getFirestore(app: App): Firestore;

パラメータ

パラメータ 説明
app アプリ 返す Firestore サービス。

戻り値:

Firestore

提供されたアプリに関連付けられているデフォルトの Firestore サービス。

// Get the default Firestore service for a specific app
const otherFirestore = getFirestore(app);

getFirestore(databaseId)

この API はデベロッパー向けのプレビュー版として提供されており、受け取ったフィードバックに基づいて変更される可能性があります。この API は本番環境で使用しないでください。

デフォルト アプリ用に指定された Firestore サービスを取得します。

署名:

export declare function getFirestore(databaseId: string): Firestore;

パラメータ

パラメータ 説明
databaseId 文字列 返されるデータベースの名前。

戻り値:

Firestore

デフォルト アプリの名前付き Firestore サービス。

// Get the Firestore service for a named database and default app
const otherFirestore = getFirestore('otherDb');

getFirestore(app, databaseId)

この API はデベロッパー向けのプレビュー版として提供されており、受け取ったフィードバックに基づいて変更される可能性があります。この API は本番環境で使用しないでください。

指定されたアプリの名前付き Firestore サービスを取得します。

署名:

export declare function getFirestore(app: App, databaseId: string): Firestore;

パラメータ

パラメータ 説明
app アプリ 返す Firestore サービス。
databaseId 文字列 返されるデータベースの名前。

戻り値:

Firestore

提供されたアプリに関連付けられている名前付きの Firestore サービス。

// Get the Firestore service for a named database and specific app.
const otherFirestore = getFirestore('otherDb');

Firestore(app, settings) の初期化

指定されたアプリのデフォルトの Firestore サービスを取得し、追加のパラメータをそのコンストラクタに渡します。

署名:

export declare function initializeFirestore(app: App, settings?: FirestoreSettings): Firestore;

パラメータ

パラメータ 説明
app アプリ 返す Firestore サービス。
設定 FirestoreSettings コンストラクタに渡される設定オブジェクト。

戻り値:

Firestore

指定されたアプリと設定に関連付けられているデフォルトの Firestore サービス。

// Get the Firestore service for a specific app, require HTTP/1.1 REST transport
const otherFirestore = initializeFirestore(app, {preferRest: true});

初期化 Firestore(app, settings, databaseId)

この API はデベロッパー向けのプレビュー版として提供されており、受け取ったフィードバックに基づいて変更される可能性があります。この API は本番環境で使用しないでください。

指定されたアプリの名前付き Firestore サービスを取得し、追加のパラメータをそのコンストラクタに渡します。

署名:

export declare function initializeFirestore(app: App, settings: FirestoreSettings, databaseId: string): Firestore;

パラメータ

パラメータ 説明
app アプリ 返す Firestore サービス。
設定 FirestoreSettings コンストラクタに渡される設定オブジェクト。
databaseId 文字列 返されるデータベースの名前。

戻り値:

Firestore

指定されたアプリと設定に関連付けられている、指定された Firestore サービス。

// Get the Firestore service for a specific app, require HTTP/1.1 REST transport
const otherFirestore = initializeFirestore(app, {preferRest: true}, 'otherDb');