use of com.google.firebase.firestore.model.FieldIndex in project firebase-android-sdk by firebase.
the class TargetTest method greaterThanOrEqualsQueryBound.
@Test
public void greaterThanOrEqualsQueryBound() {
Target target = query("c").filter(filter("foo", ">=", "bar")).toTarget();
FieldIndex index = fieldIndex("c", "foo", FieldIndex.Segment.Kind.DESCENDING);
Bound lowerBound = target.getLowerBound(index);
verifyBound(lowerBound, true, "bar");
Bound upperBound = target.getUpperBound(index);
verifyBound(upperBound, false, blob());
}
use of com.google.firebase.firestore.model.FieldIndex in project firebase-android-sdk by firebase.
the class TargetTest method greaterThanQueryBound.
@Test
public void greaterThanQueryBound() {
Target target = query("c").filter(filter("foo", ">", "bar")).toTarget();
FieldIndex index = fieldIndex("c", "foo", FieldIndex.Segment.Kind.ASCENDING);
Bound lowerBound = target.getLowerBound(index);
verifyBound(lowerBound, false, "bar");
Bound upperBound = target.getUpperBound(index);
verifyBound(upperBound, false, blob());
}
use of com.google.firebase.firestore.model.FieldIndex in project firebase-android-sdk by firebase.
the class TargetTest method equalsQueryBound.
@Test
public void equalsQueryBound() {
Target target = query("c").filter(filter("foo", "==", "bar")).toTarget();
FieldIndex index = fieldIndex("c", "foo", FieldIndex.Segment.Kind.ASCENDING);
Bound lowerBound = target.getLowerBound(index);
verifyBound(lowerBound, true, "bar");
Bound upperBound = target.getUpperBound(index);
verifyBound(upperBound, true, "bar");
}
use of com.google.firebase.firestore.model.FieldIndex in project firebase-android-sdk by firebase.
the class TargetTest method startAfterDoesNotChangeBoundIfNotApplicable.
@Test
public void startAfterDoesNotChangeBoundIfNotApplicable() {
Target target = query("c").filter(filter("a", ">=", "a2")).filter(filter("b", "==", "b2")).orderBy(orderBy("a")).orderBy(orderBy("b")).startAt(bound(/* inclusive= */
false, "a1", "b1")).toTarget();
FieldIndex index = fieldIndex("c", "a", FieldIndex.Segment.Kind.ASCENDING, "b", FieldIndex.Segment.Kind.ASCENDING);
Bound lowerBound = target.getLowerBound(index);
verifyBound(lowerBound, true, "a2", "b2");
Bound upperBound = target.getUpperBound(index);
verifyBound(upperBound, false, blob(), "b2");
}
use of com.google.firebase.firestore.model.FieldIndex in project firebase-android-sdk by firebase.
the class TargetTest method lessThanOrEqualsQueryBound.
@Test
public void lessThanOrEqualsQueryBound() {
Target target = query("c").filter(filter("foo", "<=", "bar")).toTarget();
FieldIndex index = fieldIndex("c", "foo", FieldIndex.Segment.Kind.ASCENDING);
Bound lowerBound = target.getLowerBound(index);
verifyBound(lowerBound, true, "");
Bound upperBound = target.getUpperBound(index);
verifyBound(upperBound, true, "bar");
}
Aggregations