public static Query logical(LogOp op, Collection<Query> expressions) {
        Query q = new Query(true);
        for (Query x : expressions) {
            ((ArrayNode) q.node).add(x.toJson());
        }
        Query a = new Query(false);
        a.add(op.toString(), q.toJson());
        return a;
    }
public static Query logical ( LogOp op , Collection < Query > expressions ) { Query q = new Query ( true ) ; for ( Query x : expressions ) { ( ( ArrayNode ) q . node ) . add ( x . toJson ( ) ) ; } Query a = new Query ( false ) ; a . add ( op . toString ( ) , q . toJson ( ) ) ; return a ; }
<pre>
{ $and : [ expressions ] }
{ $or : [ expressions ] }
</pre>