FirebaseFirestore Framework Reference

FIRFilter


@interface FIRFilter : NSObject

A Filter represents a restriction on one or more field values and can be used to refine the results of a Query.

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

    Declaration

    Objective-C

    + (nonnull FIRFilter *)filterWhereField:(nonnull NSString *)field
                                  isEqualTo:(nonnull id)value;

    Parameters

    field

    The field used for the filter.

    value

    The 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

    + (nonnull FIRFilter *)filterWhereFieldPath:(nonnull FIRFieldPath *)path
                                      isEqualTo:(nonnull id)value;

    Parameters

    path

    The field path used for the filter.

    value

    The 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

    + (nonnull FIRFilter *)filterWhereField:(nonnull NSString *)field
                               isNotEqualTo:(nonnull id)value;

    Parameters

    field

    The field used for the filter.

    value

    The 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

    + (nonnull FIRFilter *)filterWhereFieldPath:(nonnull FIRFieldPath *)path
                                   isNotEqualTo:(nonnull id)value;

    Parameters

    path

    The field path used for the filter.

    value

    The 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

    + (nonnull FIRFilter *)filterWhereField:(nonnull NSString *)field
                              isGreaterThan:(nonnull id)value;

    Parameters

    field

    The field used for the filter.

    value

    The 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

    + (nonnull FIRFilter *)filterWhereFieldPath:(nonnull FIRFieldPath *)path
                                  isGreaterThan:(nonnull id)value;

    Parameters

    path

    The field path used for the filter.

    value

    The 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

    + (nonnull FIRFilter *)filterWhereField:(nonnull NSString *)field
                     isGreaterThanOrEqualTo:(nonnull id)value;

    Parameters

    field

    The field used for the filter.

    value

    The 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

    + (nonnull FIRFilter *)filterWhereFieldPath:(nonnull FIRFieldPath *)path
                         isGreaterThanOrEqualTo:(nonnull id)value;

    Parameters

    path

    The field path used for the filter.

    value

    The 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

    + (nonnull FIRFilter *)filterWhereField:(nonnull NSString *)field
                                 isLessThan:(nonnull id)value;

    Parameters

    field

    The field used for the filter.

    value

    The 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

    + (nonnull FIRFilter *)filterWhereFieldPath:(nonnull FIRFieldPath *)path
                                     isLessThan:(nonnull id)value;

    Parameters

    path

    The field path used for the filter.

    value

    The 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

    + (nonnull FIRFilter *)filterWhereField:(nonnull NSString *)field
                        isLessThanOrEqualTo:(nonnull id)value;

    Parameters

    field

    The field used for the filter.

    value

    The 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

    + (nonnull FIRFilter *)filterWhereFieldPath:(nonnull FIRFieldPath *)path
                            isLessThanOrEqualTo:(nonnull id)value;

    Parameters

    path

    The field path used for the filter.

    value

    The 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

    + (nonnull FIRFilter *)filterWhereField:(nonnull NSString *)field
                              arrayContains:(nonnull id)value;

    Parameters

    field

    The field used for the filter.

    value

    The 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

    + (nonnull FIRFilter *)filterWhereFieldPath:(nonnull FIRFieldPath *)path
                                  arrayContains:(nonnull id)value;

    Parameters

    path

    The field path used for the filter.

    value

    The 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

    + (nonnull FIRFilter *)filterWhereField:(nonnull NSString *)field
                           arrayContainsAny:(nonnull NSArray<id> *)values;

    Parameters

    field

    The field used for the filter.

    values

    The 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

    + (nonnull FIRFilter *)filterWhereFieldPath:(nonnull FIRFieldPath *)path
                               arrayContainsAny:(nonnull NSArray<id> *)values;

    Parameters

    path

    The field path used for the filter.

    values

    The 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

    + (nonnull FIRFilter *)filterWhereField:(nonnull NSString *)field
                                         in:(nonnull NSArray<id> *)values;

    Parameters

    field

    The field used for the filter.

    values

    The 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

    + (nonnull FIRFilter *)filterWhereFieldPath:(nonnull FIRFieldPath *)path
                                             in:(nonnull NSArray<id> *)values;

    Parameters

    path

    The field path used for the filter.

    values

    The 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

    + (nonnull FIRFilter *)filterWhereField:(nonnull NSString *)field
                                      notIn:(nonnull NSArray<id> *)values;

    Parameters

    field

    The field path used for the filter.

    values

    The 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

    + (nonnull FIRFilter *)filterWhereFieldPath:(nonnull FIRFieldPath *)path
                                          notIn:(nonnull NSArray<id> *)values;

    Parameters

    path

    The field path used for the filter.

    values

    The 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

    + (nonnull FIRFilter *)orFilterWithFilters:
        (nonnull NSArray<FIRFilter *> *)filters;

    Parameters

    filters

    The 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

    + (nonnull FIRFilter *)andFilterWithFilters:
        (nonnull NSArray<FIRFilter *> *)filters;

    Parameters

    filters

    The list of filters to perform a disjunction for.

    Return Value

    The newly created filter.