Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6958191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:06:29+00:00 2026-05-27T15:06:29+00:00

Having some issues querying back from Mongo on Id when it’s a guid. I

  • 0

Having some issues querying back from Mongo on Id when it’s a guid. I have a really stupid test class, its just public Guid Id {get;set}. I create a collection and do an insert of this test class. In the shell i see it as

{ "_id" : BinData(3,"9q+FwoU/RE2+Iq3w7hK1JA==") } 

I then try to do

var query = Query.EQ("Id", Id);

If I look in the debugger, it shows up as

{ "Id" : CSUUID("c285aff6-3f85-4d44-be22-adf0ee12b524") }

However, it doesn’t return anything.. Am I missing something obvious here? Also, side note, the shell has no idea what CSUUID is.. is there a way to enable this? CentOS server if it matters…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:06:30+00:00Added an answer on May 27, 2026 at 3:06 pm

    Id will automatically be mapped to the reserved primary key name _id. You should change your query to

    Query.EQ("_id", Id)
    

    This should fix your problem.


    Some Background about GUIDs

    That thing about CSUUID is good to know, however: it tells you the driver is using the legacy representation of GUIDs in the C# driver. I believe this is still the default, so no need to worry. There are different encodings because other languages or operating systems have different byte orders.

    You can extend the shell to ‘understand’ different formats of GUIDs, a very helpful extension in any case for all kinds of debugging:

    https://github.com/mongodb/mongo-csharp-driver/blob/master/uuidhelpers.js

    This makes it easier to debug using the shell. Just download the js and start mongo using mongo --shell uuidhelpers.js.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been having some issues retrieving JSON data from a WCF service application
Having some issues accessing my param tags from within actionscript. Essentially I have the
We've been having some issues with a SharePoint instance in a test environment. Thankfully
I have been having some issues with LINQ-To-SQL around memory usage. I'm using it
Having some issues getting this MPMoviePlayerViewController to work. I have two sample URLs pointing
having some issues with a networking assignment. End goal is to have a C
Having some issues running my code local. I have host file setup like this:
Having some issues with C. I have this is my code: // First line
I am having some issues with special characters in Crystal Reports. I have some
Ok I am still having some issues with this code below. I have received

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.