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

aggregation: field inclusion in $group _id is not accepting integral types

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.0
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Operating System:
      ALL

      Description

      This script causes an error:

      db = db.getSiblingDB('foo');

      var r = db.runCommand({ "aggregate" : "blah", "pipeline" : [
      { "$project" : {
      "key" : 1,
      "v" : 1
      }},
      { "$group" : {
      "_id" :

      { "key" : NumberInt(1) }

      ,
      "min_v" :

      { "$min" : "$v" }

      }}
      ]});

      > r
      {
      "errmsg" : "exception: disallowed field type 16 in object expression (at
      \"key\")",
      "code" : 15992,
      "ok" : 0
      }

      I tried using NumberInt for the ones in the $project, and they were fine. Just the one in the $group has the problem.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: