firebase::firestore::Filter

#include <filter.h>

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

Summary

Constructors and Destructors

Filter(const Filter & other)
Copy constructor.
Filter(Filter && other)
Move constructor.
~Filter()

Public static functions

And(const Filters &... filters)
Creates a new filter that is a conjunction of the given filters.
And(const std::vector< Filter > & filters)
Creates a new filter that is a conjunction of the given filters.
ArrayContains(const std::string & field, const FieldValue & value)
Creates a new filter for checking that the given array field contains the given value.
ArrayContains(const FieldPath & field, const FieldValue & value)
Creates a new filter for checking that the given array field contains the given value.
ArrayContainsAny(const std::string & field, const std::vector< FieldValue > & values)
Creates a new filter for checking that the given array field contains any of the given values.
ArrayContainsAny(const FieldPath & field, const std::vector< FieldValue > & values)
Creates a new filter for checking that the given array field contains any of the given values.
EqualTo(const std::string & field, const FieldValue & value)
Creates a new filter for checking that the given field is equal to the given value.
EqualTo(const FieldPath & field, const FieldValue & value)
Creates a new filter for checking that the given field is equal to the given value.
GreaterThan(const std::string & field, const FieldValue & value)
Creates a new filter for checking that the given field is greater than the given value.
GreaterThan(const FieldPath & field, const FieldValue & value)
Creates a new filter for checking that the given field is greater than the given value.
GreaterThanOrEqualTo(const std::string & field, const FieldValue & value)
Creates a new filter for checking that the given field is greater than or equal to the given value.
GreaterThanOrEqualTo(const FieldPath & field, const FieldValue & value)
Creates a new filter for checking that the given field is greater than or equal to the given value.
In(const std::string & field, const std::vector< FieldValue > & values)
Creates a new filter for checking that the given field equals any of the given values.
In(const FieldPath & field, const std::vector< FieldValue > & values)
Creates a new filter for checking that the given field equals any of the given values.
LessThan(const std::string & field, const FieldValue & value)
Creates a new filter for checking that the given field is less than the given value.
LessThan(const FieldPath & field, const FieldValue & value)
Creates a new filter for checking that the given field is less than the given value.
LessThanOrEqualTo(const std::string & field, const FieldValue & value)
Creates a new filter for checking that the given field is less than or equal to the given value.
LessThanOrEqualTo(const FieldPath & field, const FieldValue & value)
Creates a new filter for checking that the given field is less than or equal to the given value.
NotEqualTo(const std::string & field, const FieldValue & value)
Creates a new filter for checking that the given field is not equal to the given value.
NotEqualTo(const FieldPath & field, const FieldValue & value)
Creates a new filter for checking that the given field is not equal to the given value.
NotIn(const std::string & field, const std::vector< FieldValue > & values)
Creates a new filter for checking that the given field does not equal any of the given values.
NotIn(const FieldPath & field, const std::vector< FieldValue > & values)
Creates a new filter for checking that the given field does not equal any of the given values.
Or(const Filters &... filters)
Creates a new filter that is a disjunction of the given filters.
Or(const std::vector< Filter > & filters)
Creates a new filter that is a disjunction of the given filters.

Public functions

operator=(const Filter & other)
Filter &
Copy assignment operator.
operator=(Filter && other) noexcept
Filter &
Move assignment operator.

Public static functions

And

Filter And(
  const Filters &... 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.

And

Filter And(
  const std::vector< 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.

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 list that contains filters to perform a conjunction for.
Returns
The newly created filter.

ArrayContains

Filter ArrayContains(
  const std::string & field,
  const FieldValue & value
)

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

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

ArrayContains

Filter ArrayContains(
  const FieldPath & field,
  const FieldValue & value
)

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

Details
Parameters
field
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

Filter ArrayContainsAny(
  const std::string & field,
  const std::vector< FieldValue > & values
)

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

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

ArrayContainsAny

Filter ArrayContainsAny(
  const FieldPath & field,
  const std::vector< FieldValue > & values
)

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

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

EqualTo

Filter EqualTo(
  const std::string & field,
  const FieldValue & value
)

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

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

EqualTo

Filter EqualTo(
  const FieldPath & field,
  const FieldValue & value
)

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

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

GreaterThan

Filter GreaterThan(
  const std::string & field,
  const FieldValue & value
)

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

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

GreaterThan

Filter GreaterThan(
  const FieldPath & field,
  const FieldValue & value
)

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

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

GreaterThanOrEqualTo

Filter GreaterThanOrEqualTo(
  const std::string & field,
  const FieldValue & value
)

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

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

GreaterThanOrEqualTo

Filter GreaterThanOrEqualTo(
  const FieldPath & field,
  const FieldValue & value
)

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

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

In

Filter In(
  const std::string & field,
  const std::vector< FieldValue > & values
)

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

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

In

Filter In(
  const FieldPath & field,
  const std::vector< FieldValue > & values
)

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

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

LessThan

Filter LessThan(
  const std::string & field,
  const FieldValue & value
)

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

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

LessThan

Filter LessThan(
  const FieldPath & field,
  const FieldValue & value
)

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

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

LessThanOrEqualTo

Filter LessThanOrEqualTo(
  const std::string & field,
  const FieldValue & value
)

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

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

LessThanOrEqualTo

Filter LessThanOrEqualTo(
  const FieldPath & field,
  const FieldValue & value
)

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

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

NotEqualTo

Filter NotEqualTo(
  const std::string & field,
  const FieldValue & value
)

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

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

NotEqualTo

Filter NotEqualTo(
  const FieldPath & field,
  const FieldValue & value
)

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

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

NotIn

Filter NotIn(
  const std::string & field,
  const std::vector< FieldValue > & values
)

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

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

NotIn

Filter NotIn(
  const FieldPath & field,
  const std::vector< FieldValue > & values
)

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

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

Or

Filter Or(
  const Filters &... 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.

Or

Filter Or(
  const std::vector< Filter > & 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 list that contains filters to perform a disjunction for.
Returns
The newly created filter.

Public functions

Filter

 Filter(
  const Filter & other
)

Copy constructor.

Filter is immutable and can be efficiently copied.

Details
Parameters
other
Filter to copy from.

Filter

 Filter(
  Filter && other
) noexcept

Move constructor.

Details
Parameters
other
Filter to move data from.

operator=

Filter & operator=(
  const Filter & other
)

Copy assignment operator.

Filter is immutable and can be efficiently copied.

Details
Parameters
other
Filter to copy from.
Returns
Reference to the destination Filter.

operator=

Filter & operator=(
  Filter && other
) noexcept

Move assignment operator.

Details
Parameters
other
Filter to move data from.
Returns
Reference to the destination Filter.

~Filter

 ~Filter()