Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
C# Linq Provider - Mongo Driver - How to view / tell the Mongo query that is about to be sent to the server?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jonathan Gill  
View profile  
 More options Oct 12 2012, 2:41 pm
From: Jonathan Gill <jonathan.g...@gmail.com>
Date: Fri, 12 Oct 2012 11:41:15 -0700 (PDT)
Local: Fri, Oct 12 2012 2:41 pm
Subject: C# Linq Provider - Mongo Driver - How to view / tell the Mongo query that is about to be sent to the server?

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Stam  
View profile  
 More options Oct 12 2012, 2:52 pm
From: Robert Stam <rob...@10gen.com>
Date: Fri, 12 Oct 2012 14:52:09 -0400
Local: Fri, Oct 12 2012 2:52 pm
Subject: Re: [mongodb-user] C# Linq Provider - Mongo Driver - How to view / tell the Mongo query that is about to be sent to the server?

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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic