Filter.and constructor

Filter.and(
  1. List<Filter> filters
)

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.

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;