There is. You can do this:
var query =
from x in collection.AsQueryable<C>()
where x.Id == 1
select x;
var json = ((MongoQueryable<C>)query).GetMongoQuery().ToJson();
The json variable is now a string that represents the native MongoDB query.
On Fri, Oct 12, 2012 at 2:41 PM, Jonathan Gill <jonathan.g...@gmail.com>wrote:
> We're having an issue were we need to see the Mongo query that is being
> sent to Mongo from the Mongo C# driver's LINQ provider for a "complex"
> query with ANDs and ORs.
> Is there a property or way to view this in C# from the IQueryable that is
> being built up?
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb