use of com.google.firebase.firestore.core.Query in project firebase-android-sdk by firebase.
the class SQLiteIndexManagerTest method testNestedFieldEqualityFilter.
@Test
public void testNestedFieldEqualityFilter() {
indexManager.addFieldIndex(fieldIndex("coll", "a.b", Kind.ASCENDING));
addDoc("coll/doc1", map("a", map("b", 1)));
addDoc("coll/doc2", map("a", map("b", 2)));
Query query = query("coll").filter(filter("a.b", "==", 2));
verifyResults(query, "coll/doc2");
}
use of com.google.firebase.firestore.core.Query in project firebase-android-sdk by firebase.
the class SQLiteIndexManagerTest method testNotInWithGreaterThanFilter.
@Test
public void testNotInWithGreaterThanFilter() {
setUpSingleValueFilter();
Query query = query("coll").filter(filter("count", ">", 1)).filter(filter("count", "not-in", Collections.singletonList(2)));
verifyResults(query, "coll/val3");
}
use of com.google.firebase.firestore.core.Query in project firebase-android-sdk by firebase.
the class SQLiteIndexManagerTest method testStartAtFilter.
@Test
public void testStartAtFilter() {
setUpSingleValueFilter();
Query query = query("coll").orderBy(orderBy("count")).startAt(bound(/* inclusive= */
true, 2));
verifyResults(query, "coll/val2", "coll/val3");
}
use of com.google.firebase.firestore.core.Query in project firebase-android-sdk by firebase.
the class SQLiteIndexManagerTest method testEndBeforeFilter.
@Test
public void testEndBeforeFilter() {
setUpSingleValueFilter();
Query query = query("coll").orderBy(orderBy("count")).endAt(bound(/* inclusive= */
false, 2));
verifyResults(query, "coll/val1");
}
use of com.google.firebase.firestore.core.Query in project firebase-android-sdk by firebase.
the class SQLiteIndexManagerTest method testIndexEntriesAreUpdatedWithDeletedDoc.
@Test
public void testIndexEntriesAreUpdatedWithDeletedDoc() {
indexManager.addFieldIndex(fieldIndex("coll", "value", Kind.ASCENDING));
Query query = query("coll").orderBy(orderBy("value"));
addDoc("coll/doc1", map("value", true));
verifyResults(query, "coll/doc1");
addDocs(deletedDoc("coll/doc1", 1));
verifyResults(query);
}
Aggregations