firebase::firestore::Filter

#include <filter.h>

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

Summary

Constructors and Destructors

Filter(constFilter & 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, constFieldValue & value)
Creates a new filter for checking that the given array field contains the given value.
ArrayContains(constFieldPath & field, constFieldValue & 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(constFieldPath & 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, constFieldValue & value)
Creates a new filter for checking that the given field is equal to the given value.
EqualTo(constFieldPath & field, constFieldValue & value)
Creates a new filter for checking that the given field is equal to the given value.
GreaterThan(const std::string & field, constFieldValue & value)
Creates a new filter for checking that the given field is greater than the given value.
GreaterThan(constFieldPath & field, constFieldValue & value)
Creates a new filter for checking that the given field is greater than the given value.
GreaterThanOrEqualTo(const std::string & field, constFieldValue & value)
Creates a new filter for checking that the given field is greater than or equal to the given value.
GreaterThanOrEqualTo(constFieldPath & field, constFieldValue & 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(constFieldPath & 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, constFieldValue & value)
Creates a new filter for checking that the given field is less than the given value.
LessThan(constFieldPath & field, constFieldValue & value)
Creates a new filter for checking that the given field is less than the given value.
LessThanOrEqualTo(const std::string & field, constFieldValue & value)
Creates a new filter for checking that the given field is less than or equal to the given value.
LessThanOrEqualTo(constFieldPath & field, constFieldValue & 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, constFieldValue & value)
Creates a new filter for checking that the given field is not equal to the given value.
NotEqualTo(constFieldPath & field, constFieldValue & 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(constFieldPath & 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=(constFilter & other)
Copy assignment operator.
operator=(Filter && other) noexcept
Move assignment operator.

Public static functions

And

FilterAnd(constFilters&...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

FilterAnd(conststd::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

FilterArrayContains(conststd::string&field,constFieldValue&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

FilterArrayContains(constFieldPath&field,constFieldValue&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

FilterArrayContainsAny(conststd::string&field,conststd::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

FilterArrayContainsAny(constFieldPath&field,conststd::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

FilterEqualTo(conststd::string&field,constFieldValue&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

FilterEqualTo(constFieldPath&field,constFieldValue&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

FilterGreaterThan(conststd::string&field,constFieldValue&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

FilterGreaterThan(constFieldPath&field,constFieldValue&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

FilterGreaterThanOrEqualTo(conststd::string&field,constFieldValue&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

FilterGreaterThanOrEqualTo(constFieldPath&field,constFieldValue&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

FilterIn(conststd::string&field,conststd::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

FilterIn(constFieldPath&field,conststd::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

FilterLessThan(conststd::string&field,constFieldValue&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

FilterLessThan(constFieldPath&field,constFieldValue&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

FilterLessThanOrEqualTo(conststd::string&field,constFieldValue&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

FilterLessThanOrEqualTo(constFieldPath&field,constFieldValue&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

FilterNotEqualTo(conststd::string&field,constFieldValue&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

FilterNotEqualTo(constFieldPath&field,constFieldValue&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

FilterNotIn(conststd::string&field,conststd::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

FilterNotIn(constFieldPath&field,conststd::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

FilterOr(constFilters&...filters)

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

A disjunction filter includes a document if it satisfiesany 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

FilterOr(conststd::vector<Filter>&filters)

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

A disjunction filter includes a document if it satisfiesany 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(constFilter&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=(constFilter&other)

Copy assignment operator.

Filter is immutable and can be efficiently copied.

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

operator=

Filter&operator=(Filter&&other)noexcept

Move assignment operator.

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

~Filter

~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 2024-01-23 UTC.