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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.0
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None
    • ALL

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            cwestin Chris Westin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: