Filter.and constructor
Creates and returns 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.
The returned Filter can be applied to Query.where(), Filter.or, or Filter.and. When applied to a Query it requires that documents must satisfy one of the provided Filters.
filter
: The Filters for AND operation. These must be created with calls to Filter.where, Filter.or, or Filter.and.
final collectionRef = firestore.collection('col');
// doc.foo == 'bar' && doc.baz > 0
final andFilter = Filter.and(Filter.where('foo', WhereFilter.equal, 'bar'), Filter.where('baz', WhereFilter.greaterThan, 0));
collectionRef.where(andFilter).get().then((querySnapshot) {
querySnapshot.forEach((documentSnapshot) {
print('Found document at ${documentSnapshot.ref.path}');
});
});
Implementation
factory Filter.and(List<Filter> filters) = _CompositeFilter.and;