Skip to content

Commit a722b11

Browse files
Add setDocMerge method.
resolves #62
1 parent 25a06a9 commit a722b11

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
@@ -77,6 +77,15 @@ export class GeoFireCollectionRef {
7777
setDoc(id: string, data: any) {
7878
return this.ref.doc(id).set(data);
7979
}
80+
/**
81+
* Create or update a document in the collection based on the document ID merging fields
82+
* @param {string} id
83+
* @param {any} data
84+
* @returns {Promise<void>}
85+
*/
86+
setDocMerge(id: string, data: any) {
87+
return this.ref.doc(id).set(data, { merge: true });
88+
}
8089
/**
8190
* Create or update a document with GeoFirePoint data
8291
* @param {string} id document id

0 commit comments

Comments
 (0)