Firebase.Firestore.Filter

AFilter represents a restriction on one or more field values and can be used to refine the results of aQuery.

Summary

Public static functions

And(paramsFilter[] filters)
Creates a new filter that is a conjunction of the given filters.
ArrayContains(string fieldPath, object value)
Creates a new filter for checking that the given array field contains the given value.
ArrayContains(FieldPath fieldPath, object value)
Creates a new filter for checking that the given array field contains the given value.
ArrayContainsAny(string fieldPath, IEnumerable< object > values)
Creates a new filter for checking that the given array field contains any of the given values.
ArrayContainsAny(FieldPath fieldPath, IEnumerable< object > values)
Creates a new filter for checking that the given array field contains any of the given values.
EqualTo(string fieldPath, object value)
Creates a new filter for checking that the given field is equal to the given value.
EqualTo(FieldPath fieldPath, object value)
Creates a new filter for checking that the given field is equal to the given value.
GreaterThan(string fieldPath, object value)
Creates a new filter for checking that the given field is greater than the given value.
GreaterThan(FieldPath fieldPath, object value)
Creates a new filter for checking that the given field is greater than the given value.
GreaterThanOrEqualTo(string fieldPath, object value)
Creates a new filter for checking that the given field is greater than or equal to the given value.
GreaterThanOrEqualTo(FieldPath fieldPath, object value)
Creates a new filter for checking that the given field is greater than or equal to the given value.
In(string fieldPath, IEnumerable< object > values)
Creates a new filter for checking that the given field equals any of the given values.
In(FieldPath fieldPath, IEnumerable< object > values)
Creates a new filter for checking that the given field equals any of the given values.
LessThan(string fieldPath, object value)
Creates a new filter for checking that the given field is less than the given value.
LessThan(FieldPath fieldPath, object value)
Creates a new filter for checking that the given field is less than the given value.
LessThanOrEqualTo(string fieldPath, object value)
Creates a new filter for checking that the given field is less than or equal to the given value.
LessThanOrEqualTo(FieldPath fieldPath, object value)
Creates a new filter for checking that the given field is less than or equal to the given value.
NotEqualTo(string fieldPath, object value)
Creates a new filter for checking that the given field is not equal to the given value.
NotEqualTo(FieldPath fieldPath, object value)
Creates a new filter for checking that the given field is not equal to the given value.
NotIn(string fieldPath, IEnumerable< object > values)
Creates a new filter for checking that the given field does not equal any of the given values.
NotIn(FieldPath fieldPath, IEnumerable< object > values)
Creates a new filter for checking that the given field does not equal any of the given values.
Or(paramsFilter[] filters)
Creates a new filter that is a disjunction of the given filters.

Public static functions

And

FilterAnd(paramsFilter[]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.

If no filter is given, the composite filter is a no-op, and if only one filter is given, the composite filter has the same behavior as the underlying filter.

Details
Parameters
filters
The filters to perform a conjunction for.
Returns
The newly created filter.

ArrayContains

FilterArrayContains(stringfieldPath,objectvalue)

Creates a new filter for checking that the given array field contains the given value.

Details
Parameters
fieldPath
The name of the field containing an array to search.
value
The value that must be contained in the array.
Returns

ArrayContains

FilterArrayContains(FieldPathfieldPath,objectvalue)

Creates a new filter for checking that the given array field contains the given value.

Details
Parameters
fieldPath
The path of the field containing an array to search.
value
The value that must be contained in the array.
Returns
The newly created filter.

ArrayContainsAny

FilterArrayContainsAny(stringfieldPath,IEnumerable<object>values)

Creates a new filter for checking that the given array field contains any of the given values.

Details
Parameters
fieldPath
The name of the field containing an array to search.
values
The list of values to match.
Returns
The newly created filter.

ArrayContainsAny

FilterArrayContainsAny(FieldPathfieldPath,IEnumerable<object>values)

Creates a new filter for checking that the given array field contains any of the given values.

Details
Parameters
fieldPath
The path of the field containing an array to search.
values
The list of values to match.
Returns
The newly created filter.

EqualTo

FilterEqualTo(stringfieldPath,objectvalue)

Creates a new filter for checking that the given field is equal to the given value.

Details
Parameters
fieldPath
The name of the field to compare.
value
The value for comparison.
Returns
The newly created filter.

EqualTo

FilterEqualTo(FieldPathfieldPath,objectvalue)

Creates a new filter for checking that the given field is equal to the given value.

Details
Parameters
fieldPath
The path of the field containing an array to search.
value
The value for comparison.
Returns
The newly created filter.

GreaterThan

FilterGreaterThan(stringfieldPath,objectvalue)

Creates a new filter for checking that the given field is greater than the given value.

Details
Parameters
fieldPath
The name of the field to compare.
value
The value for comparison.
Returns
The newly created filter.

GreaterThan

FilterGreaterThan(FieldPathfieldPath,objectvalue)

Creates a new filter for checking that the given field is greater than the given value.

Details
Parameters
fieldPath
The path of the field to compare.
value
The value for comparison.
Returns
The newly created filter.

GreaterThanOrEqualTo

FilterGreaterThanOrEqualTo(stringfieldPath,objectvalue)

Creates a new filter for checking that the given field is greater than or equal to the given value.

Details
Parameters
fieldPath
The name of the field to compare.
value
The value for comparison.
Returns
The newly created filter.

GreaterThanOrEqualTo

FilterGreaterThanOrEqualTo(FieldPathfieldPath,objectvalue)

Creates a new filter for checking that the given field is greater than or equal to the given value.

Details
Parameters
fieldPath
The path of the field to compare.
value
The value for comparison.
Returns
The newly created filter.

In

FilterIn(stringfieldPath,IEnumerable<object>values)

Creates a new filter for checking that the given field equals any of the given values.

Details
Parameters
fieldPath
The name of the field to compare.
values
The list of values to match.
Returns

In

FilterIn(FieldPathfieldPath,IEnumerable<object>values)

Creates a new filter for checking that the given field equals any of the given values.

Details
Parameters
fieldPath
The path of the field to compare.
values
The list of values to match.
Returns
The newly created filter.

LessThan

FilterLessThan(stringfieldPath,objectvalue)

Creates a new filter for checking that the given field is less than the given value.

Details
Parameters
fieldPath
The name of the field to compare.
value
The value for comparison.
Returns
The newly created filter.

LessThan

FilterLessThan(FieldPathfieldPath,objectvalue)

Creates a new filter for checking that the given field is less than the given value.

Details
Parameters
fieldPath
The path of the field to compare.
value
The value for comparison.
Returns
The newly created filter.

LessThanOrEqualTo

FilterLessThanOrEqualTo(stringfieldPath,objectvalue)

Creates a new filter for checking that the given field is less than or equal to the given value.

Details
Parameters
fieldPath
The name of the field to compare.
value
The value for comparison.
Returns
The newly created filter.

LessThanOrEqualTo

FilterLessThanOrEqualTo(FieldPathfieldPath,objectvalue)

Creates a new filter for checking that the given field is less than or equal to the given value.

Details
Parameters
fieldPath
The path of the field to compare.
value
The value for comparison.
Returns
The newly created filter.

NotEqualTo

FilterNotEqualTo(stringfieldPath,objectvalue)

Creates a new filter for checking that the given field is not equal to the given value.

Details
Parameters
fieldPath
The name of the field to compare.
value
The value for comparison.
Returns
The newly created filter.

NotEqualTo

FilterNotEqualTo(FieldPathfieldPath,objectvalue)

Creates a new filter for checking that the given field is not equal to the given value.

Details
Parameters
fieldPath
The path of the field to compare.
value
The value for comparison.
Returns
The newly created filter.

NotIn

FilterNotIn(stringfieldPath,IEnumerable<object>values)

Creates a new filter for checking that the given field does not equal any of the given values.

Details
Parameters
fieldPath
The name of the field to compare.
values
The list of values to match.
Returns
The newly created filter.

NotIn

FilterNotIn(FieldPathfieldPath,IEnumerable<object>values)

Creates a new filter for checking that the given field does not equal any of the given values.

Details
Parameters
fieldPath
The path of the field to compare.
values
The list of values to match.
Returns
The newly created filter.

Or

FilterOr(paramsFilter[]filters)

Creates a new filter that is a disjunction of the given filters.

A disjunction filter includes a document if it satisfies any of the given filters.

If no filter is given, the composite filter is a no-op, and if only one filter is given, the composite filter has the same behavior as the underlying filter.

Details
Parameters
filters
The filters to perform a disjunction for.
Returns
The newly created filter.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2023-10-19 UTC.