and

fun and(filters: Iterable<Bson?>): Bson
fun and(vararg filters: Bson?): Bson

Creates a filter that performs a logical AND of the provided list of filters. Note that this will only generate a "$and" operator if absolutely necessary, as the query language implicity ands together all the keys. In other words, a query expression like:

and(eq("x", 1), lt("y", 3))
*

will generate a MongoDB query like:

{x : 1, y : {$lt : 3}}
*

Return

the filter

Parameters

filters

the list of filters to and together