Monday 15 September 2014

c# - Insert list of ImongoQuery into Query.And -



c# - Insert list of ImongoQuery into Query.And -

instead of doing this:

var query = query.and( query.matches("", new bsonregularexpression(new regex(""))), query.matches("", new bsonregularexpression(new regex(""))) );

i'd this:

foreach(var g in gs) { query.addandrange(g); }

is there way this?

if understood question right, solution like:

var query = query.and(new bindinglist<imongoquery> { query0, query1, query2, query3, query4, });

or

var list = new bindinglist<imongoquery>(); foreach (var g in gs) list.add(g); var query = new query.and(list);

c# database mongodb

No comments:

Post a Comment