@@ -75,12 +75,20 @@ Document LocalDocumentsView::GetDocument(
7575
7676DocumentMap LocalDocumentsView::GetDocumentsMatchingQuery (
7777 const Query& query, const model::IndexOffset& offset) {
78+ absl::optional<QueryContext> null_context;
79+ return GetDocumentsMatchingQuery (query, offset, null_context);
80+ }
81+
82+ DocumentMap LocalDocumentsView::GetDocumentsMatchingQuery (
83+ const Query& query,
84+ const model::IndexOffset& offset,
85+ absl::optional<QueryContext>& context) {
7886 if (query.IsDocumentQuery ()) {
7987 return GetDocumentsMatchingDocumentQuery (query.path ());
8088 } else if (query.IsCollectionGroupQuery ()) {
81- return GetDocumentsMatchingCollectionGroupQuery (query, offset);
89+ return GetDocumentsMatchingCollectionGroupQuery (query, offset, context );
8290 } else {
83- return GetDocumentsMatchingCollectionQuery (query, offset);
91+ return GetDocumentsMatchingCollectionQuery (query, offset, context );
8492 }
8593}
8694
@@ -96,7 +104,9 @@ DocumentMap LocalDocumentsView::GetDocumentsMatchingDocumentQuery(
96104}
97105
98106model::DocumentMap LocalDocumentsView::GetDocumentsMatchingCollectionGroupQuery (
99- const Query& query, const IndexOffset& offset) {
107+ const Query& query,
108+ const IndexOffset& offset,
109+ absl::optional<QueryContext>& context) {
100110 HARD_ASSERT (
101111 query.path ().empty (),
102112 " Currently we only support collection group queries at the root." );
@@ -112,7 +122,7 @@ model::DocumentMap LocalDocumentsView::GetDocumentsMatchingCollectionGroupQuery(
112122 Query collection_query =
113123 query.AsCollectionQueryAtPath (parent.Append (collection_id));
114124 DocumentMap collection_results =
115- GetDocumentsMatchingCollectionQuery (collection_query, offset);
125+ GetDocumentsMatchingCollectionQuery (collection_query, offset, context );
116126 for (const auto & kv : collection_results) {
117127 const DocumentKey& key = kv.first ;
118128 results = results.insert (key, Document (kv.second ));
@@ -153,13 +163,15 @@ LocalWriteResult LocalDocumentsView::GetNextDocuments(
153163}
154164
155165DocumentMap LocalDocumentsView::GetDocumentsMatchingCollectionQuery (
156- const Query& query, const IndexOffset& offset) {
166+ const Query& query,
167+ const IndexOffset& offset,
168+ absl::optional<QueryContext>& context) {
157169 // Get locally mutated documents
158170 OverlayByDocumentKeyMap overlays = document_overlay_cache_->GetOverlays (
159171 query.path (), offset.largest_batch_id ());
160172 MutableDocumentMap remote_documents =
161173 remote_document_cache_->GetDocumentsMatchingQuery (
162- query, offset, absl::nullopt , overlays);
174+ query, offset, context, absl::nullopt , overlays);
163175
164176 // As documents might match the query because of their overlay we need to
165177 // include documents for all overlays in the initial document set.
0 commit comments