and method
Combine current expression with expression in parameter.
See MongoDB doc
SelectorBuilder provides implicit and
operator for chained queries so these two expression will produce
identical MongoDB queries
where.eq('price', 1.99).lt('qty', 20).eq('sale', true);
where.eq('price', 1.99).and(where.lt('qty',20)).and(where.eq('sale', true))
Both these queries would produce json map:
{'\$query': {'\$and': [{'price':1.99},{'qty': {'\$lt': 20 }}, {'sale': true }]}}
Implementation
SelectorBuilder and(SelectorBuilder other) {
if (_query.isEmpty) {
throw StateError('`And` operation is not supported on empty query');
}
_addExpressionMap(other._query);
return this;
}