FirebaseFirestore Framework Reference Stay organized with collections Save and categorize content based on your preferences.
FIRFilter
@interfaceFIRFilter:NSObjectA Filter represents a restriction on one or more field values and can be used to refinethe results of a Query.
Creates a new filter for checking that the given field is equal to the given value.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereField:(nonnullNSString*)fieldisEqualTo:(nonnullid)value;Parameters
fieldThe field used for the filter.
valueThe value used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given field is equal to the given value.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereFieldPath:(nonnullFIRFieldPath*)pathisEqualTo:(nonnullid)value;Parameters
pathThe field path used for the filter.
valueThe value used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given field is not equal to the given value.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereField:(nonnullNSString*)fieldisNotEqualTo:(nonnullid)value;Parameters
fieldThe field used for the filter.
valueThe value used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given field is not equal to the given value.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereFieldPath:(nonnullFIRFieldPath*)pathisNotEqualTo:(nonnullid)value;Parameters
pathThe field path used for the filter.
valueThe value used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given field is greater than the given value.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereField:(nonnullNSString*)fieldisGreaterThan:(nonnullid)value;Parameters
fieldThe field used for the filter.
valueThe value used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given field is greater than the given value.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereFieldPath:(nonnullFIRFieldPath*)pathisGreaterThan:(nonnullid)value;Parameters
pathThe field path used for the filter.
valueThe value used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given field is greater than or equal to the given value.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereField:(nonnullNSString*)fieldisGreaterThanOrEqualTo:(nonnullid)value;Parameters
fieldThe field used for the filter.
valueThe value used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given field is greater than or equal to the given value.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereFieldPath:(nonnullFIRFieldPath*)pathisGreaterThanOrEqualTo:(nonnullid)value;Parameters
pathThe field path used for the filter.
valueThe value used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given field is less than the given value.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereField:(nonnullNSString*)fieldisLessThan:(nonnullid)value;Parameters
fieldThe field used for the filter.
valueThe value used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given field is less than the given value.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereFieldPath:(nonnullFIRFieldPath*)pathisLessThan:(nonnullid)value;Parameters
pathThe field path used for the filter.
valueThe value used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given field is less than or equal to the given value.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereField:(nonnullNSString*)fieldisLessThanOrEqualTo:(nonnullid)value;Parameters
fieldThe field used for the filter.
valueThe value used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given field is less than or equal to the given value.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereFieldPath:(nonnullFIRFieldPath*)pathisLessThanOrEqualTo:(nonnullid)value;Parameters
pathThe field path used for the filter.
valueThe value used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given array field contains the given value.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereField:(nonnullNSString*)fieldarrayContains:(nonnullid)value;Parameters
fieldThe field used for the filter.
valueThe value used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given array field contains the given value.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereFieldPath:(nonnullFIRFieldPath*)patharrayContains:(nonnullid)value;Parameters
pathThe field path used for the filter.
valueThe value used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given array field contains any of the given values.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereField:(nonnullNSString*)fieldarrayContainsAny:(nonnullNSArray<id>*)values;Parameters
fieldThe field used for the filter.
valuesThe list of values used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given array field contains any of the given values.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereFieldPath:(nonnullFIRFieldPath*)patharrayContainsAny:(nonnullNSArray<id>*)values;Parameters
pathThe field path used for the filter.
valuesThe list of values used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given field equals any of the given values.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereField:(nonnullNSString*)fieldin:(nonnullNSArray<id>*)values;Parameters
fieldThe field used for the filter.
valuesThe list of values used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given field equals any of the given values.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereFieldPath:(nonnullFIRFieldPath*)pathin:(nonnullNSArray<id>*)values;Parameters
pathThe field path used for the filter.
valuesThe list of values used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given field does not equal any of the given values.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereField:(nonnullNSString*)fieldnotIn:(nonnullNSArray<id>*)values;Parameters
fieldThe field path used for the filter.
valuesThe list of values used for the filter.
Return Value
The newly created filter.
Creates a new filter for checking that the given field does not equal any of the given values.
Declaration
Objective-C
+(nonnullFIRFilter*)filterWhereFieldPath:(nonnullFIRFieldPath*)pathnotIn:(nonnullNSArray<id>*)values;Parameters
pathThe field path used for the filter.
valuesThe list of values used for the filter.
Return Value
The newly created filter.
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.
Declaration
Objective-C
+(nonnullFIRFilter*)orFilterWithFilters:(nonnullNSArray<FIRFilter*>*)filters;Parameters
filtersThe list of filters to perform a disjunction for.
Return Value
The newly created filter.
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.
Declaration
Objective-C
+(nonnullFIRFilter*)andFilterWithFilters:(nonnullNSArray<FIRFilter*>*)filters;Parameters
filtersThe list of filters to perform a disjunction for.
Return Value
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 2025-03-11 UTC.