Query operate issue

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.12.1
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I use Mongodb 2.6.1.
      Reproduce steps:
      1. used Mongdb command db.test.insert({item:'a',qty:12}) to create a document.
      2. use command `db.test.aggregate({$match:{qty:12}})` to query document, the result is:

      { "_id" : ObjectId("53b9fcd6a50ca592c6e34b34"), "item" : "a", "qty" : 12 }

      3. use java api function “dbCollection.aggregate(args…)” to query document, the result is

      { "_id" : { "$oid" : "53b9fcd6a50ca592c6e34b34"} , "item" : "a" , "qty" : 12.0}

      As the result from step 2 and step 3, the field "qty" value is different.
      The java api result should not have ".0".

            Assignee:
            Ross Lawley
            Reporter:
            Dong [X]
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: