firebase-rest-firestore 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +5 -0
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -152,6 +152,11 @@ class FirestoreClient {
|
|
|
152
152
|
// 操作前に設定をチェック
|
|
153
153
|
this.checkConfig();
|
|
154
154
|
const url = `${(0, path_1.getFirestoreBasePath)(this.config.projectId, collectionName, this.config.databaseId)}/${documentId}`;
|
|
155
|
+
// 既存のドキュメントを取得してからマージする
|
|
156
|
+
const existingDoc = await this.get(collectionName, documentId);
|
|
157
|
+
if (existingDoc) {
|
|
158
|
+
data = { ...existingDoc, ...data };
|
|
159
|
+
}
|
|
155
160
|
const firestoreData = (0, converter_1.convertToFirestoreDocument)(data);
|
|
156
161
|
const token = await this.getToken();
|
|
157
162
|
const response = await fetch(url, {
|