Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-849

Bug in query builder when selecting with ids for some ulong values

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.8.3
    • Component/s: None
    • None
    • Environment:
      Windows 7, VS 2012, x64 bit CPU
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When selecting a document using C# drivers v1.8.3.9. If the id is casted as ulong the query does not return document for some ulong values (e.g. 5935691471546811785). But for most ulongs the query does return the documents (e.g. 5935691471546877322). There appears to be no pattern for ulong values for which document will be returned or not. But if the id is casted as long, query always returns the document with the id.

      Finds nothing ("Enumeration yielded no results"):
      • collection.Find(Query.EQ(Collection.Fields.ID, (ulong) 5935691471546811785))
      • {
      "_id" : NumberLong("5935691471546811785"),
      "test" : ["test_does_not_work"
      }

      Finds the document:
      • collection.Find(Query.EQ(Collection.Fields.ID, (ulong) 5935691471546877322))

      • {
      "_id" : NumberLong("5935691471546877322"),
      "test" : ["test_works"
      }

      Fix:
      Finds the document:
      collection.Find(Query.EQ(Collection.Fields.ID, (long) 5935691471546811785))

            Assignee:
            Unassigned Unassigned
            Reporter:
            hahmed Hassan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: