@Test @Ignore("Pending cr/164068667") public void updateDocumentQuery() { addDocument(IGNORED_DOC); addDocument(NON_MATCHING_DOC); updateDocument(NON_MATCHING_DOC, MATCHING_DOC); Query query = query("coll").filter(filter("a", "==", "a")); ImmutableSortedMap<DocumentKey, Document> results = queryEngine.getDocumentsMatchingQuery( query, null, DocumentKey.emptyKeySet()); assertThat(results).doesNotContain(IGNORED_DOC.getKey()); assertThat(results).contains(MATCHING_DOC.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);  }