Skip to content

Commit e44437d

Browse files
authored
Support setDoc with merge options
1 parent 25a06a9 commit e44437d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/collection.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ export interface GeoQueryOptions {
1313
}
1414
const defaultOpts: GeoQueryOptions = { units: 'km' };
1515

16+
export interface SetOptions {
17+
merge?: boolean;
18+
mergeFields?: (string | FieldPath)[];
19+
}
20+
1621
export interface QueryMetadata {
1722
bearing: number;
1823
distance: number;
@@ -72,10 +77,11 @@ export class GeoFireCollectionRef {
7277
* Create or update a document in the collection based on the document ID
7378
* @param {string} id
7479
* @param {any} data
80+
* @param {SetOptions} options
7581
* @returns {Promise<void>}
7682
*/
77-
setDoc(id: string, data: any) {
78-
return this.ref.doc(id).set(data);
83+
setDoc(id: string, data: any, options?: SetOptions) {
84+
return this.ref.doc(id).set(data, options);
7985
}
8086
/**
8187
* Create or update a document with GeoFirePoint data

0 commit comments

Comments
 (0)