Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 2b7c1e8

Browse files
committed
added firestore into query, documentReference, collectionReference to support geofirestore
1 parent 2a43e43 commit 2b7c1e8

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/firebase.android.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,6 +2213,7 @@ firebase.firestore._getDocumentReference = (docRef?: JDocumentReference): firest
22132213
id: docRef.getId(),
22142214
parent: firebase.firestore._getCollectionReference(docRef.getParent()),
22152215
path: docRef.getPath(),
2216+
firestore: firebase.firestore,
22162217
collection: cp => firebase.firestore.collection(`${collectionPath}/${docRef.getId()}/${cp}`),
22172218
set: (data: any, options?: firestore.SetOptions) => firebase.firestore.set(collectionPath, docRef.getId(), data, options),
22182219
get: (options?: firestore.GetOptions) => firebase.firestore.getDocument(collectionPath, docRef.getId(), options),
@@ -2233,6 +2234,7 @@ firebase.firestore._getCollectionReference = (colRef?: JCollectionReference): fi
22332234
return {
22342235
id: colRef.getId(),
22352236
parent: firebase.firestore._getDocumentReference(colRef.getParent()),
2237+
firestore: firebase.firestore,
22362238
doc: (documentPath?: string) => firebase.firestore.doc(collectionPath, documentPath),
22372239
add: document => firebase.firestore.add(collectionPath, document),
22382240
get: (options?: firestore.GetOptions) => firebase.firestore.get(collectionPath, options),
@@ -2530,6 +2532,7 @@ firebase.firestore._getQuery = (collectionPath: string, query: com.google.fireba
25302532
startAt: (snapshot: DocumentSnapshot) => firebase.firestore.startAt(collectionPath, snapshot, query),
25312533
endAt: (snapshot: DocumentSnapshot) => firebase.firestore.endAt(collectionPath, snapshot, query),
25322534
endBefore: (snapshot: DocumentSnapshot) => firebase.firestore.endBefore(collectionPath, snapshot, query),
2535+
firestore: firebase.firestore
25332536
};
25342537
};
25352538

src/firebase.ios.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,6 +1871,7 @@ firebase.firestore._getCollectionReference = (colRef?: FIRCollectionReference):
18711871
return {
18721872
id: colRef.collectionID,
18731873
parent: firebase.firestore._getDocumentReference(colRef.parent),
1874+
firestore: firebase.firestore,
18741875
doc: (documentPath?: string) => firebase.firestore.doc(collectionPath, documentPath),
18751876
add: document => firebase.firestore.add(collectionPath, document),
18761877
get: (options?: firestore.GetOptions) => firebase.firestore.get(collectionPath, options),
@@ -1897,6 +1898,7 @@ firebase.firestore._getDocumentReference = (docRef?: FIRDocumentReference): fire
18971898
id: docRef.documentID,
18981899
parent: firebase.firestore._getCollectionReference(docRef.parent),
18991900
path: docRef.path,
1901+
firestore: firebase.firestore,
19001902
collection: cp => firebase.firestore.collection(`${collectionPath}/${docRef.documentID}/${cp}`),
19011903
set: (data: any, options?: firestore.SetOptions) => firebase.firestore.set(collectionPath, docRef.documentID, data, options),
19021904
get: (options?: firestore.GetOptions) => firebase.firestore.getDocument(collectionPath, docRef.documentID, options),
@@ -2199,6 +2201,7 @@ firebase.firestore._getQuery = (collectionPath: string, query: FIRQuery): firest
21992201
startAt: (document: DocumentSnapshot) => firebase.firestore.startAt(collectionPath, document, query),
22002202
endAt: (document: DocumentSnapshot) => firebase.firestore.endAt(collectionPath, document, query),
22012203
endBefore: (document: DocumentSnapshot) => firebase.firestore.endBefore(collectionPath, document, query),
2204+
firestore: firebase.firestore
22022205
};
22032206
};
22042207

0 commit comments

Comments
 (0)