Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-11407

aggregation results for same dataset/query differ on mongodb 2.4.4 vs 2.5.3

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.4, 2.5.3
    • Component/s: Querying
    • Labels:
      None
    • Environment:
      Ubuntu 12.04 (64 bit)
    • Linux

      With reference to the attached dataset test9371.json imported into a collection 'zips' (on mongodb 2.4.4 and mongodb 2.5.3),
      when we run the following query :

      db.zips.aggregate( { $group:
                               { _id: { state: "$state", city: "$city" },
                                 zipcount : {$sum : 1},
                                 pop: { $sum: "$pop" } } },
                             { $sort: { zipcount: 1 } },
                             { $group:
                               { _id : "$_id.state",
                                 biggestCity:  { $last: "$_id.city" },
                                 population:   { $last: "$pop" },
                              zipcount : { $last : "$zipcount"}
                                  } } ,{ $sort : {population : -1}})
      

      different results are returned on mongodb 2.4.4 (pls refer to attached results_244.png) and mongodb 2.5.3.(pls refer results_253.png).
      Could you please investigate whats causing this discrepancy? Thank you

        1. aggregation_query.txt
          0.6 kB
        2. results_244.png
          results_244.png
          108 kB
        3. results_253.png
          results_253.png
          129 kB
        4. test9371.json
          2 kB

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            rkshakya Ravi Shakya
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: