Filter
public class Filter
A Filter represents a restriction on one or more field values and can be used to refine the results of a Query.
Summary
Public constructors |
|---|
Filter() |
Public methods |
|
|---|---|
static @NonNull Filter |
and(Filter[] filters)Creates a new filter that is a conjunction of the given filters. |
static @NonNull Filter |
arrayContains(@NonNull String field, @Nullable Object value)Creates a new filter for checking that the given array field contains the given value. |
static @NonNull Filter |
arrayContains(@NonNull FieldPath fieldPath, @Nullable Object value)Creates a new filter for checking that the given array field contains the given value. |
static @NonNull Filter |
Creates a new filter for checking that the given array field contains any of the given values. |
static @NonNull Filter |
Creates a new filter for checking that the given array field contains any of the given values. |
static @NonNull Filter |
Creates a new filter for checking that the given field is equal to the given value. |
static @NonNull Filter |
Creates a new filter for checking that the given field is equal to the given value. |
static @NonNull Filter |
greaterThan(@NonNull String field, @Nullable Object value)Creates a new filter for checking that the given field is greater than the given value. |
static @NonNull Filter |
greaterThan(@NonNull FieldPath fieldPath, @Nullable Object value)Creates a new filter for checking that the given field is greater than the given value. |
static @NonNull Filter |
greaterThanOrEqualTo(@NonNull String field, @Nullable Object value)Creates a new filter for checking that the given field is greater than or equal to the given value. |
static @NonNull Filter |
greaterThanOrEqualTo(@NonNull FieldPath fieldPath, @Nullable Object value)Creates a new filter for checking that the given field is greater than or equal to the given value. |
static @NonNull Filter |
Creates a new filter for checking that the given field equals any of the given values. |
static @NonNull Filter |
Creates a new filter for checking that the given field equals any of the given values. |
static @NonNull Filter |
Creates a new filter for checking that the given field is less than the given value. |
static @NonNull Filter |
Creates a new filter for checking that the given field is less than the given value. |
static @NonNull Filter |
lessThanOrEqualTo(@NonNull String field, @Nullable Object value)Creates a new filter for checking that the given field is less than or equal to the given value. |
static @NonNull Filter |
lessThanOrEqualTo(@NonNull FieldPath fieldPath, @Nullable Object value)Creates a new filter for checking that the given field is less than or equal to the given value. |
static @NonNull Filter |
notEqualTo(@NonNull String field, @Nullable Object value)Creates a new filter for checking that the given field is not equal to the given value. |
static @NonNull Filter |
notEqualTo(@NonNull FieldPath fieldPath, @Nullable Object value)Creates a new filter for checking that the given field is not equal to the given value. |
static @NonNull Filter |
Creates a new filter for checking that the given field does not equal any of the given values. |
static @NonNull Filter |
Creates a new filter for checking that the given field does not equal any of the given values. |
static @NonNull Filter |
or(Filter[] filters)Creates a new filter that is a disjunction of the given filters. |
Public constructors
Public methods
and
public static @NonNull Filter and(Filter[] filters)
Creates a new filter that is a conjunction of the given filters. A conjunction filter includes a document if it satisfies all of the given filters.
| Parameters | |
|---|---|
Filter[] filters |
The list of filters to perform a conjunction for. |
arrayContains
public static @NonNull Filter arrayContains(@NonNull String field, @Nullable Object value)
Creates a new filter for checking that the given array field contains the given value.
arrayContains
public static @NonNull Filter arrayContains(@NonNull FieldPath fieldPath, @Nullable Object value)
Creates a new filter for checking that the given array field contains the given value.
arrayContainsAny
public static @NonNull Filter arrayContainsAny(@NonNull String field, @NonNull List<Object> values)
Creates a new filter for checking that the given array field contains any of the given values.
arrayContainsAny
public static @NonNull Filter arrayContainsAny(
@NonNull FieldPath fieldPath,
@NonNull List<Object> values
)
Creates a new filter for checking that the given array field contains any of the given values.
equalTo
public static @NonNull Filter equalTo(@NonNull String field, @Nullable Object value)
Creates a new filter for checking that the given field is equal to the given value.
equalTo
public static @NonNull Filter equalTo(@NonNull FieldPath fieldPath, @Nullable Object value)
Creates a new filter for checking that the given field is equal to the given value.
greaterThan
public static @NonNull Filter greaterThan(@NonNull String field, @Nullable Object value)
Creates a new filter for checking that the given field is greater than the given value.
greaterThan
public static @NonNull Filter greaterThan(@NonNull FieldPath fieldPath, @Nullable Object value)
Creates a new filter for checking that the given field is greater than the given value.
greaterThanOrEqualTo
public static @NonNull Filter greaterThanOrEqualTo(@NonNull String field, @Nullable Object value)
Creates a new filter for checking that the given field is greater than or equal to the given value.
greaterThanOrEqualTo
public static @NonNull Filter greaterThanOrEqualTo(@NonNull FieldPath fieldPath, @Nullable Object value)
Creates a new filter for checking that the given field is greater than or equal to the given value.
inArray
public static @NonNull Filter inArray(@NonNull String field, @NonNull List<Object> values)
Creates a new filter for checking that the given field equals any of the given values.
inArray
public static @NonNull Filter inArray(@NonNull FieldPath fieldPath, @NonNull List<Object> values)
Creates a new filter for checking that the given field equals any of the given values.
lessThan
public static @NonNull Filter lessThan(@NonNull String field, @Nullable Object value)
Creates a new filter for checking that the given field is less than the given value.
lessThan
public static @NonNull Filter lessThan(@NonNull FieldPath fieldPath, @Nullable Object value)
Creates a new filter for checking that the given field is less than the given value.
lessThanOrEqualTo
public static @NonNull Filter lessThanOrEqualTo(@NonNull String field, @Nullable Object value)
Creates a new filter for checking that the given field is less than or equal to the given value.
lessThanOrEqualTo
public static @NonNull Filter lessThanOrEqualTo(@NonNull FieldPath fieldPath, @Nullable Object value)
Creates a new filter for checking that the given field is less than or equal to the given value.
notEqualTo
public static @NonNull Filter notEqualTo(@NonNull String field, @Nullable Object value)
Creates a new filter for checking that the given field is not equal to the given value.
notEqualTo
public static @NonNull Filter notEqualTo(@NonNull FieldPath fieldPath, @Nullable Object value)
Creates a new filter for checking that the given field is not equal to the given value.
notInArray
public static @NonNull Filter notInArray(@NonNull String field, @NonNull List<Object> values)
Creates a new filter for checking that the given field does not equal any of the given values.
notInArray
public static @NonNull Filter notInArray(@NonNull FieldPath fieldPath, @NonNull List<Object> values)
Creates a new filter for checking that the given field does not equal any of the given values.