Skip to content

Commit 48d649f

Browse files
committed
Address feedback
1 parent 3f7a970 commit 48d649f

File tree

8 files changed

+131
-57
lines changed

8 files changed

+131
-57
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/PersistentCacheIndexManager.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,15 @@
2222
* A {@code PersistentCacheIndexManager} which you can config persistent cache indexes used for
2323
* local query execution.
2424
*
25-
* <p>To use, calling {@link FirebaseFirestore#getPersistentCacheIndexManager()} to get an instance.
25+
* <p>To use, call {@link FirebaseFirestore#getPersistentCacheIndexManager()} to get an instance.
2626
*/
2727
// TODO(csi): Remove the `hide` and scope annotations.
2828
/** @hide */
2929
@RestrictTo(RestrictTo.Scope.LIBRARY)
3030
public final class PersistentCacheIndexManager {
3131
@NonNull private FirestoreClient client;
3232

33-
@RestrictTo(RestrictTo.Scope.LIBRARY)
34-
public PersistentCacheIndexManager(FirestoreClient client) {
33+
PersistentCacheIndexManager(FirestoreClient client) {
3534
this.client = client;
3635
}
3736

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ ImmutableSortedMap<DocumentKey, Document> getDocumentsMatchingQuery(
281281
*/
282282
ImmutableSortedMap<DocumentKey, Document> getDocumentsMatchingQuery(
283283
Query query, IndexOffset offset) {
284-
return getDocumentsMatchingQuery(query, offset, null);
284+
return getDocumentsMatchingQuery(query, offset, /*context*/ null);
285285
}
286286

287287
/** Performs a simple document lookup for the given path. */

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public Map<DocumentKey, MutableDocument> getDocumentsMatchingQuery(
142142
@Override
143143
public Map<DocumentKey, MutableDocument> getDocumentsMatchingQuery(
144144
Query query, IndexOffset offset, @Nonnull Set<DocumentKey> mutatedKeys) {
145-
return getDocumentsMatchingQuery(query, offset, mutatedKeys, null);
145+
return getDocumentsMatchingQuery(query, offset, mutatedKeys, /*context*/ null);
146146
}
147147

148148
Iterable<Document> getDocuments() {

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

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,17 @@
6161
*/
6262
public class QueryEngine {
6363
private static final String LOG_TAG = "QueryEngine";
64+
6465
private static final int MIN_COLLECTION_SIZE_TO_AUTO_CREATE_INDEX = 100;
6566

67+
// TODO(csi): update the temp cost.
68+
/**
69+
* This cost represents the evaluation result of (([index, docKey] + [docKey, docContent]) per
70+
* document in the result set) / ([docKey, docContent] per documents in full collection scan)
71+
* coming from experiment https://github.com/firebase/firebase-android-sdk/pull/5064.
72+
*/
73+
private static final int RELATIVE_INDEX_READ_COST = 3;
74+
6675
private LocalDocumentsView localDocumentsView;
6776
private IndexManager indexManager;
6877
private boolean initialized;
@@ -72,6 +81,8 @@ public class QueryEngine {
7281
/** SDK only decides whether it should create index when collection size is larger than this. */
7382
private int minCollectionSizeToAutoCreateIndex = MIN_COLLECTION_SIZE_TO_AUTO_CREATE_INDEX;
7483

84+
private int relativeIndexReadCost = RELATIVE_INDEX_READ_COST;
85+
7586
public void initialize(LocalDocumentsView localDocumentsView, IndexManager indexManager) {
7687
this.localDocumentsView = localDocumentsView;
7788
this.indexManager = indexManager;
@@ -125,9 +136,16 @@ private void createCacheIndexes(Query query, QueryContext context, int resultSiz
125136
return;
126137
}
127138

139+
if (Logger.isDebugEnabled()) {
140+
Logger.debug(
141+
LOG_TAG,
142+
"Query scans %s local documents and returns %s documents as results.",
143+
context.getDocumentReadCount(),
144+
resultSize);
145+
}
146+
128147
String decisionStr = "";
129-
// If evaluation is updated, please update tests in SQLiteLocalStoreTest.java
130-
if (context.getDocumentReadCount() > 2 * resultSize) {
148+
if (context.getDocumentReadCount() > relativeIndexReadCost * resultSize) {
131149
indexManager.createTargetIndices(query.toTarget());
132150
} else {
133151
decisionStr = " not";
@@ -136,11 +154,8 @@ private void createCacheIndexes(Query query, QueryContext context, int resultSiz
136154
if (Logger.isDebugEnabled()) {
137155
Logger.debug(
138156
LOG_TAG,
139-
"Query ran locally using a full collection scan, walking through %s documents in total "
140-
+ "and returning %s documents. The SDK has decided%s to create cache indexes "
141-
+ "for this query, as using cache indexes may%s help improve performance.",
142-
context.getDocumentReadCount(),
143-
resultSize,
157+
"The SDK decides%s to create cache indexes for this query, as using cache indexes "
158+
+ "may%s help improve performance.",
144159
decisionStr,
145160
decisionStr);
146161
}
@@ -324,4 +339,9 @@ private ImmutableSortedMap<DocumentKey, Document> appendRemainingResults(
324339
void setMinCollectionSizeToAutoCreateIndex(int newMin) {
325340
minCollectionSizeToAutoCreateIndex = newMin;
326341
}
342+
343+
@VisibleForTesting
344+
void setRelativeIndexReadCost(int newCost) {
345+
relativeIndexReadCost = newCost;
346+
}
327347
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ private Map<DocumentKey, MutableDocument> getAll(
236236
IndexOffset offset,
237237
int count,
238238
@Nullable Function<MutableDocument, Boolean> filter) {
239-
return getAll(collections, offset, count, filter, null);
239+
return getAll(collections, offset, count, filter, /*context*/ null);
240240
}
241241

242242
private void processRowInBackground(
@@ -266,7 +266,7 @@ private void processRowInBackground(
266266
@Override
267267
public Map<DocumentKey, MutableDocument> getDocumentsMatchingQuery(
268268
Query query, IndexOffset offset, @Nonnull Set<DocumentKey> mutatedKeys) {
269-
return getDocumentsMatchingQuery(query, offset, mutatedKeys, null);
269+
return getDocumentsMatchingQuery(query, offset, mutatedKeys, /*context*/ null);
270270
}
271271

272272
@Override

firebase-firestore/src/test/java/com/google/firebase/firestore/local/CountingQueryEngine.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ public void setMinCollectionSizeToAutoCreateIndex(int newMin) {
102102
queryEngine.setMinCollectionSizeToAutoCreateIndex(newMin);
103103
}
104104

105+
@Override
106+
public void setRelativeIndexReadCost(int newCost) {
107+
queryEngine.setRelativeIndexReadCost(newCost);
108+
}
109+
105110
/**
106111
* Returns the number of documents returned by the RemoteDocumentCache's `getAll()` API (since the
107112
* last call to `resetCounts()`)
@@ -186,7 +191,7 @@ public Map<DocumentKey, MutableDocument> getAll(
186191
@Override
187192
public Map<DocumentKey, MutableDocument> getDocumentsMatchingQuery(
188193
Query query, IndexOffset offset, @NonNull Set<DocumentKey> mutatedKeys) {
189-
return getDocumentsMatchingQuery(query, offset, mutatedKeys, null);
194+
return getDocumentsMatchingQuery(query, offset, mutatedKeys, /*context*/ null);
190195
}
191196

192197
@Override

firebase-firestore/src/test/java/com/google/firebase/firestore/local/LocalStoreTestCase.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ protected void setMinCollectionSizeToAutoCreateIndex(int newMin) {
236236
queryEngine.setMinCollectionSizeToAutoCreateIndex(newMin);
237237
}
238238

239+
protected void setRelativeIndexReadCost(int newCost) {
240+
queryEngine.setRelativeIndexReadCost(newCost);
241+
}
242+
239243
private void releaseTarget(int targetId) {
240244
localStore.releaseTarget(targetId);
241245
}

firebase-firestore/src/test/java/com/google/firebase/firestore/local/SQLiteLocalStoreTest.java

Lines changed: 88 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,13 @@ public void testDeeplyNestedServerTimestamps() {
368368
}
369369

370370
@Test
371-
public void testIndexAutoCreationWorks() {
371+
public void testCanAutoCreateIndexes() {
372372
Query query = query("coll").filter(filter("matches", "==", true));
373373
int targetId = allocateQuery(query);
374374

375375
enableIndexAutoCreation();
376376
setMinCollectionSizeToAutoCreateIndex(0);
377+
setRelativeIndexReadCost(2);
377378

378379
applyRemoteEvent(addedRemoteEvent(doc("coll/a", 10, map("matches", true)), targetId));
379380
applyRemoteEvent(addedRemoteEvent(doc("coll/b", 10, map("matches", false)), targetId));
@@ -398,17 +399,18 @@ public void testIndexAutoCreationWorks() {
398399
}
399400

400401
@Test
401-
public void testIndexAutoCreationDoesNotWorkWhenCollectionSizeIsTooSmall() {
402-
Query query = query("coll").filter(filter("matches", "==", true));
402+
public void testDoesNotAutoCreateIndexesForSmallCollections() {
403+
Query query = query("coll").filter(filter("count", ">=", 3));
403404
int targetId = allocateQuery(query);
404405

405406
enableIndexAutoCreation();
407+
setRelativeIndexReadCost(2);
406408

407-
applyRemoteEvent(addedRemoteEvent(doc("coll/a", 10, map("matches", true)), targetId));
408-
applyRemoteEvent(addedRemoteEvent(doc("coll/b", 10, map("matches", false)), targetId));
409-
applyRemoteEvent(addedRemoteEvent(doc("coll/c", 10, map("matches", false)), targetId));
410-
applyRemoteEvent(addedRemoteEvent(doc("coll/d", 10, map("matches", false)), targetId));
411-
applyRemoteEvent(addedRemoteEvent(doc("coll/e", 10, map("matches", true)), targetId));
409+
applyRemoteEvent(addedRemoteEvent(doc("coll/a", 10, map("count", 5)), targetId));
410+
applyRemoteEvent(addedRemoteEvent(doc("coll/b", 10, map("count", 1)), targetId));
411+
applyRemoteEvent(addedRemoteEvent(doc("coll/c", 10, map("count", 0)), targetId));
412+
applyRemoteEvent(addedRemoteEvent(doc("coll/d", 10, map("count", 1)), targetId));
413+
applyRemoteEvent(addedRemoteEvent(doc("coll/e", 10, map("count", 3)), targetId));
412414

413415
// SDK will not create indexes since collection size is too small.
414416
executeQuery(query);
@@ -417,7 +419,41 @@ public void testIndexAutoCreationDoesNotWorkWhenCollectionSizeIsTooSmall() {
417419

418420
backfillIndexes();
419421

420-
applyRemoteEvent(addedRemoteEvent(doc("coll/f", 20, map("matches", true)), targetId));
422+
applyRemoteEvent(addedRemoteEvent(doc("coll/f", 20, map("count", 4)), targetId));
423+
424+
executeQuery(query);
425+
assertRemoteDocumentsRead(/* byKey= */ 0, /* byCollection= */ 3);
426+
assertQueryReturned("coll/a", "coll/e", "coll/f");
427+
}
428+
429+
@Test
430+
public void testDoesNotAutoCreateIndexesWhenIndexLookUpIsExpensive() {
431+
Query query = query("coll").filter(filter("array", "array-contains-any", Arrays.asList(0, 7)));
432+
int targetId = allocateQuery(query);
433+
434+
enableIndexAutoCreation();
435+
setMinCollectionSizeToAutoCreateIndex(0);
436+
setRelativeIndexReadCost(5);
437+
438+
applyRemoteEvent(
439+
addedRemoteEvent(doc("coll/a", 10, map("array", Arrays.asList(2, 7))), targetId));
440+
applyRemoteEvent(addedRemoteEvent(doc("coll/b", 10, map("array", emptyList())), targetId));
441+
applyRemoteEvent(addedRemoteEvent(doc("coll/c", 10, map("array", singletonList(3))), targetId));
442+
applyRemoteEvent(
443+
addedRemoteEvent(doc("coll/d", 10, map("array", Arrays.asList(2, 10, 20))), targetId));
444+
applyRemoteEvent(
445+
addedRemoteEvent(doc("coll/e", 10, map("array", Arrays.asList(2, 0, 8))), targetId));
446+
447+
// First time query runs without indexes.
448+
// Based on current heuristic, collection document counts (5) > 2 * resultSize (2).
449+
// Full matched index should be created.
450+
executeQuery(query);
451+
assertRemoteDocumentsRead(/* byKey= */ 0, /* byCollection= */ 2);
452+
assertQueryReturned("coll/a", "coll/e");
453+
454+
backfillIndexes();
455+
456+
applyRemoteEvent(addedRemoteEvent(doc("coll/f", 20, map("array", singletonList(0))), targetId));
421457

422458
executeQuery(query);
423459
assertRemoteDocumentsRead(/* byKey= */ 0, /* byCollection= */ 3);
@@ -426,17 +462,18 @@ public void testIndexAutoCreationDoesNotWorkWhenCollectionSizeIsTooSmall() {
426462

427463
@Test
428464
public void testIndexAutoCreationWorksWhenBackfillerRunsHalfway() {
429-
Query query = query("coll").filter(filter("matches", "==", true));
465+
Query query = query("coll").filter(filter("matches", "==", "foo"));
430466
int targetId = allocateQuery(query);
431467

432468
enableIndexAutoCreation();
433469
setMinCollectionSizeToAutoCreateIndex(0);
470+
setRelativeIndexReadCost(2);
434471

435-
applyRemoteEvent(addedRemoteEvent(doc("coll/a", 10, map("matches", true)), targetId));
436-
applyRemoteEvent(addedRemoteEvent(doc("coll/b", 10, map("matches", false)), targetId));
437-
applyRemoteEvent(addedRemoteEvent(doc("coll/c", 10, map("matches", false)), targetId));
438-
applyRemoteEvent(addedRemoteEvent(doc("coll/d", 10, map("matches", false)), targetId));
439-
applyRemoteEvent(addedRemoteEvent(doc("coll/e", 10, map("matches", true)), targetId));
472+
applyRemoteEvent(addedRemoteEvent(doc("coll/a", 10, map("matches", "foo")), targetId));
473+
applyRemoteEvent(addedRemoteEvent(doc("coll/b", 10, map("matches", "")), targetId));
474+
applyRemoteEvent(addedRemoteEvent(doc("coll/c", 10, map("matches", "bar")), targetId));
475+
applyRemoteEvent(addedRemoteEvent(doc("coll/d", 10, map("matches", 7)), targetId));
476+
applyRemoteEvent(addedRemoteEvent(doc("coll/e", 10, map("matches", "foo")), targetId));
440477

441478
// First time query is running without indexes.
442479
// Based on current heuristic, collection document counts (5) > 2 * resultSize (2).
@@ -449,7 +486,7 @@ public void testIndexAutoCreationWorksWhenBackfillerRunsHalfway() {
449486
setBackfillerMaxDocumentsToProcess(2);
450487
backfillIndexes();
451488

452-
applyRemoteEvent(addedRemoteEvent(doc("coll/f", 20, map("matches", true)), targetId));
489+
applyRemoteEvent(addedRemoteEvent(doc("coll/f", 20, map("matches", "foo")), targetId));
453490

454491
executeQuery(query);
455492
assertRemoteDocumentsRead(/* byKey= */ 1, /* byCollection= */ 2);
@@ -458,17 +495,18 @@ public void testIndexAutoCreationWorksWhenBackfillerRunsHalfway() {
458495

459496
@Test
460497
public void testIndexCreatedByIndexAutoCreationExistsAfterTurnOffAutoCreation() {
461-
Query query = query("coll").filter(filter("matches", "==", true));
498+
Query query = query("coll").filter(filter("value", "not-in", Collections.singletonList(3)));
462499
int targetId = allocateQuery(query);
463500

464501
enableIndexAutoCreation();
465502
setMinCollectionSizeToAutoCreateIndex(0);
503+
setRelativeIndexReadCost(2);
466504

467-
applyRemoteEvent(addedRemoteEvent(doc("coll/a", 10, map("matches", true)), targetId));
468-
applyRemoteEvent(addedRemoteEvent(doc("coll/b", 10, map("matches", false)), targetId));
469-
applyRemoteEvent(addedRemoteEvent(doc("coll/c", 10, map("matches", false)), targetId));
470-
applyRemoteEvent(addedRemoteEvent(doc("coll/d", 10, map("matches", false)), targetId));
471-
applyRemoteEvent(addedRemoteEvent(doc("coll/e", 10, map("matches", true)), targetId));
505+
applyRemoteEvent(addedRemoteEvent(doc("coll/a", 10, map("value", 5)), targetId));
506+
applyRemoteEvent(addedRemoteEvent(doc("coll/b", 10, map("value", 3)), targetId));
507+
applyRemoteEvent(addedRemoteEvent(doc("coll/c", 10, map("value", 3)), targetId));
508+
applyRemoteEvent(addedRemoteEvent(doc("coll/d", 10, map("value", 3)), targetId));
509+
applyRemoteEvent(addedRemoteEvent(doc("coll/e", 10, map("value", 2)), targetId));
472510

473511
// First time query runs without indexes.
474512
// Based on current heuristic, collection document counts (5) > 2 * resultSize (2).
@@ -481,7 +519,7 @@ public void testIndexCreatedByIndexAutoCreationExistsAfterTurnOffAutoCreation()
481519

482520
backfillIndexes();
483521

484-
applyRemoteEvent(addedRemoteEvent(doc("coll/f", 20, map("matches", true)), targetId));
522+
applyRemoteEvent(addedRemoteEvent(doc("coll/f", 20, map("value", 7)), targetId));
485523

486524
executeQuery(query);
487525
assertRemoteDocumentsRead(/* byKey= */ 2, /* byCollection= */ 1);
@@ -490,17 +528,18 @@ public void testIndexCreatedByIndexAutoCreationExistsAfterTurnOffAutoCreation()
490528

491529
@Test
492530
public void testDisableIndexAutoCreationWorks() {
493-
Query query1 = query("coll").filter(filter("matches", "==", true));
531+
Query query1 = query("coll").filter(filter("value", "in", Arrays.asList(0, 1)));
494532
int targetId1 = allocateQuery(query1);
495533

496534
enableIndexAutoCreation();
497535
setMinCollectionSizeToAutoCreateIndex(0);
536+
setRelativeIndexReadCost(2);
498537

499-
applyRemoteEvent(addedRemoteEvent(doc("coll/a", 10, map("matches", true)), targetId1));
500-
applyRemoteEvent(addedRemoteEvent(doc("coll/b", 10, map("matches", false)), targetId1));
501-
applyRemoteEvent(addedRemoteEvent(doc("coll/c", 10, map("matches", false)), targetId1));
502-
applyRemoteEvent(addedRemoteEvent(doc("coll/d", 10, map("matches", false)), targetId1));
503-
applyRemoteEvent(addedRemoteEvent(doc("coll/e", 10, map("matches", true)), targetId1));
538+
applyRemoteEvent(addedRemoteEvent(doc("coll/a", 10, map("value", 1)), targetId1));
539+
applyRemoteEvent(addedRemoteEvent(doc("coll/b", 10, map("value", 8)), targetId1));
540+
applyRemoteEvent(addedRemoteEvent(doc("coll/c", 10, map("value", "string")), targetId1));
541+
applyRemoteEvent(addedRemoteEvent(doc("coll/d", 10, map("value", false)), targetId1));
542+
applyRemoteEvent(addedRemoteEvent(doc("coll/e", 10, map("value", 0)), targetId1));
504543

505544
// First time query is running without indexes.
506545
// Based on current heuristic, collection document counts (5) > 2 * resultSize (2).
@@ -517,36 +556,43 @@ public void testDisableIndexAutoCreationWorks() {
517556
assertRemoteDocumentsRead(/* byKey= */ 2, /* byCollection= */ 0);
518557
assertQueryReturned("coll/a", "coll/e");
519558

520-
Query query2 = query("foo").filter(filter("matches", "==", true));
559+
Query query2 = query("foo").filter(filter("value", "!=", Double.NaN));
521560
int targetId2 = allocateQuery(query2);
522561

523-
applyRemoteEvent(addedRemoteEvent(doc("foo/a", 10, map("matches", true)), targetId2));
524-
applyRemoteEvent(addedRemoteEvent(doc("foo/b", 10, map("matches", false)), targetId2));
525-
applyRemoteEvent(addedRemoteEvent(doc("foo/c", 10, map("matches", false)), targetId2));
526-
applyRemoteEvent(addedRemoteEvent(doc("foo/d", 10, map("matches", false)), targetId2));
527-
applyRemoteEvent(addedRemoteEvent(doc("foo/e", 10, map("matches", true)), targetId2));
562+
applyRemoteEvent(addedRemoteEvent(doc("foo/a", 10, map("value", 5)), targetId2));
563+
applyRemoteEvent(addedRemoteEvent(doc("foo/b", 10, map("value", Double.NaN)), targetId2));
564+
applyRemoteEvent(addedRemoteEvent(doc("foo/c", 10, map("value", Double.NaN)), targetId2));
565+
applyRemoteEvent(addedRemoteEvent(doc("foo/d", 10, map("value", Double.NaN)), targetId2));
566+
applyRemoteEvent(addedRemoteEvent(doc("foo/e", 10, map("value", "string")), targetId2));
528567

529568
executeQuery(query2);
530569
assertRemoteDocumentsRead(/* byKey= */ 0, /* byCollection= */ 2);
531570

571+
backfillIndexes();
572+
532573
// Run the query in second time, test index won't be created
533574
executeQuery(query2);
534575
assertRemoteDocumentsRead(/* byKey= */ 0, /* byCollection= */ 2);
535576
}
536577

537578
@Test
538579
public void testIndexAutoCreationWorksWithMutation() {
539-
Query query = query("coll").filter(filter("matches", "==", true));
580+
Query query =
581+
query("coll").filter(filter("value", "array-contains-any", Arrays.asList(8, 1, "string")));
540582
int targetId = allocateQuery(query);
541583

542584
enableIndexAutoCreation();
543585
setMinCollectionSizeToAutoCreateIndex(0);
586+
setRelativeIndexReadCost(2);
544587

545-
applyRemoteEvent(addedRemoteEvent(doc("coll/a", 10, map("matches", true)), targetId));
546-
applyRemoteEvent(addedRemoteEvent(doc("coll/b", 10, map("matches", false)), targetId));
547-
applyRemoteEvent(addedRemoteEvent(doc("coll/c", 10, map("matches", false)), targetId));
548-
applyRemoteEvent(addedRemoteEvent(doc("coll/d", 10, map("matches", false)), targetId));
549-
applyRemoteEvent(addedRemoteEvent(doc("coll/e", 10, map("matches", true)), targetId));
588+
applyRemoteEvent(
589+
addedRemoteEvent(doc("coll/a", 10, map("value", Arrays.asList(8, 1, "string"))), targetId));
590+
applyRemoteEvent(addedRemoteEvent(doc("coll/b", 10, map("value", emptyList())), targetId));
591+
applyRemoteEvent(addedRemoteEvent(doc("coll/c", 10, map("value", singletonList(3))), targetId));
592+
applyRemoteEvent(
593+
addedRemoteEvent(doc("coll/d", 10, map("value", Arrays.asList(0, 5))), targetId));
594+
applyRemoteEvent(
595+
addedRemoteEvent(doc("coll/e", 10, map("value", singletonList("string"))), targetId));
550596

551597
executeQuery(query);
552598
assertRemoteDocumentsRead(/* byKey= */ 0, /* byCollection= */ 2);
@@ -556,7 +602,7 @@ public void testIndexAutoCreationWorksWithMutation() {
556602

557603
backfillIndexes();
558604

559-
writeMutation(setMutation("coll/f", map("matches", true)));
605+
writeMutation(setMutation("coll/f", map("value", singletonList(1))));
560606

561607
executeQuery(query);
562608
assertRemoteDocumentsRead(/* byKey= */ 1, /* byCollection= */ 0);

0 commit comments

Comments
 (0)