Skip to content

Commit cbdfd5f

Browse files
committed
add a comment about _why_ filterDocumentType=FOUND_DOCUMENT is specified to getAll()
1 parent a466c0b commit cbdfd5f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/local/SQLiteRemoteDocumentCache.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ public Map<DocumentKey, MutableDocument> getDocumentsMatchingQuery(
315315
Collections.singletonList(query.getPath()),
316316
offset,
317317
Integer.MAX_VALUE,
318+
// Specify filterDocumentType=FOUND_DOCUMENT to getAll() as an optimization, because
319+
// query.matches(doc) will return false for all non-"found" document types anyways.
320+
// See https://github.com/firebase/firebase-android-sdk/issues/7295
318321
DocumentType.FOUND_DOCUMENT,
319322
(MutableDocument doc) -> query.matches(doc) || mutatedKeys.contains(doc.getKey()),
320323
context);

0 commit comments

Comments
 (0)