@Test @Ignore("Pending cr/164068667") public void nestedQuery() { Document nonMatchingDoc = doc("coll/a", ORIGINAL_VERSION, map("a", map("a", "b"))); Document matchingDoc = doc("coll/a", UPDATED_VERSION, map("a", map("a", "a"))); Document ignoredDoc = doc("coll/b", ORIGINAL_VERSION, map("a", map("a", "b"))); addDocument(nonMatchingDoc); addDocument(ignoredDoc); updateDocument(nonMatchingDoc, matchingDoc); Query query = query("coll").filter(filter("a.a", "==", "a")); ImmutableSortedMap<DocumentKey, Document> results = queryEngine.getDocumentsMatchingQuery( query, null, DocumentKey.emptyKeySet()); assertThat(results).doesNotContain(ignoredDoc.getKey()); assertThat(results).contains(matchingDoc.getKey()); }
@Override public ImmutableSortedMap<DocumentKey, Document> getDocumentsMatchingQuery( Query query, SnapshotVersion lastLimboFreeSnapshotVersion, ImmutableSortedSet<DocumentKey> remoteKeys) { hardAssert(localDocuments != null, "setLocalDocumentsView() not called"); return query.isDocumentQuery() ? localDocuments.getDocumentsMatchingQuery(query, SnapshotVersion.NONE) : performCollectionQuery(query); }
IndexedQueryEngine implements QueryEngine { @Override public ImmutableSortedMap<DocumentKey, Document> getDocumentsMatchingQuery( Query query, SnapshotVersion lastLimboFreeSnapshotVersion, ImmutableSortedSet<DocumentKey> remoteKeys) { hardAssert(localDocuments != null, "setLocalDocumentsView() not called"); return query.isDocumentQuery() ? localDocuments.getDocumentsMatchingQuery(query, SnapshotVersion.NONE) : performCollectionQuery(query); } }
IndexedQueryEngine implements QueryEngine { @Override public ImmutableSortedMap<DocumentKey, Document> getDocumentsMatchingQuery( Query query, SnapshotVersion lastLimboFreeSnapshotVersion, ImmutableSortedSet<DocumentKey> remoteKeys) { hardAssert(localDocuments != null, "setLocalDocumentsView() not called"); return query.isDocumentQuery() ? localDocuments.getDocumentsMatchingQuery(query, SnapshotVersion.NONE) : performCollectionQuery(query); } IndexedQueryEngine(SQLiteCollectionIndex collectionIndex); }
IndexedQueryEngine implements QueryEngine { @Override public ImmutableSortedMap<DocumentKey, Document> getDocumentsMatchingQuery( Query query, SnapshotVersion lastLimboFreeSnapshotVersion, ImmutableSortedSet<DocumentKey> remoteKeys) { hardAssert(localDocuments != null, "setLocalDocumentsView() not called"); return query.isDocumentQuery() ? localDocuments.getDocumentsMatchingQuery(query, SnapshotVersion.NONE) : performCollectionQuery(query); } IndexedQueryEngine(SQLiteCollectionIndex collectionIndex); @Override void setLocalDocumentsView(LocalDocumentsView localDocuments); @Override ImmutableSortedMap<DocumentKey, Document> getDocumentsMatchingQuery(
      Query query,
      SnapshotVersion lastLimboFreeSnapshotVersion,
      ImmutableSortedSet<DocumentKey> remoteKeys); @Override void handleDocumentChange(MaybeDocument oldDocument, MaybeDocument newDocument); }
IndexedQueryEngine implements QueryEngine { @Override public ImmutableSortedMap<DocumentKey, Document> getDocumentsMatchingQuery( Query query, SnapshotVersion lastLimboFreeSnapshotVersion, ImmutableSortedSet<DocumentKey> remoteKeys) { hardAssert(localDocuments != null, "setLocalDocumentsView() not called"); return query.isDocumentQuery() ? localDocuments.getDocumentsMatchingQuery(query, SnapshotVersion.NONE) : performCollectionQuery(query); } IndexedQueryEngine(SQLiteCollectionIndex collectionIndex); @Override void setLocalDocumentsView(LocalDocumentsView localDocuments); @Override ImmutableSortedMap<DocumentKey, Document> getDocumentsMatchingQuery(
      Query query,
      SnapshotVersion lastLimboFreeSnapshotVersion,
      ImmutableSortedSet<DocumentKey> remoteKeys); @Override void handleDocumentChange(MaybeDocument oldDocument, MaybeDocument newDocument);  }