Skip to content

Commit 164920a

Browse files
authored
Merge pull request #63 from LiamKarlMitchell/patch-1
Add setDocMerge method.
2 parents 23a2424 + a722b11 commit 164920a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/collection.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ export class GeoFireCollectionRef<T> {
7676
setDoc(id: string, data: any) {
7777
return this.ref.doc(id).set(data);
7878
}
79+
/**
80+
* Create or update a document in the collection based on the document ID merging fields
81+
* @param {string} id
82+
* @param {any} data
83+
* @returns {Promise<void>}
84+
*/
85+
setDocMerge(id: string, data: any) {
86+
return this.ref.doc(id).set(data, { merge: true });
87+
}
7988
/**
8089
* Create or update a document with GeoFirePoint data
8190
* @param {string} id document id

0 commit comments

Comments
 (0)