a.
unread,Dec 20, 2010, 7:02:20 PM12/20/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
Hi,
Does the Query class support these kind of queries?
{ field: { $gte: lowerBound, $lte: upperBound } }
Using Query.And to combine the two parts throws an
InvalidOperationException in BsonDocument.
Query.And(Query.GTE(fieldName, lowerBound), Query.LTE(fieldName,
upperBound));
The only way i was able to build a query is something like:
Query.EQ(fieldName, new BsonDocument { Query.EQ("$gte",
lowerBound).ToBsonDocument(), Query.EQ("$lte",
upperBound).ToBsonDocument() })
Of course manually building the whole query with BsonDocuemnt works
too, but i'd think there is an easier way to do this.
If this is unsupported, please let me know, and i'll try to implement
it for myself.
Thanks,
a.