Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1307

Query operate issue

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.12.1
    • None
    • None

    Description

      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".

      Attachments

        Activity

          People

            ross@mongodb.com Ross Lawley
            Rambo Dong [X]
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: