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

MapReduce returns undefined _id

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.8.2, 1.9.0
    • Affects Version/s: 1.8.0
    • Component/s: MapReduce
    • None
    • ALL

      >> db.test.insert(

      {x : 0}

      )
      >> var m = function()

      { emit(this.mod, this.x); }

      >> var r = function(k,v) { total = 0; for(i in v)

      { total+= v[i]; }

      return total; }
      >> db.test.mapReduce(m, r,

      {out : "test.out"}

      )
      {
      "result" : "test.out",
      "timeMillis" : 1,
      "counts" :

      { "input" : 1, "emit" : 1, "output" : 1 }

      ,
      "ok" : 1,
      }

      In the result, _id is undefined (it looks like null in the shell, but if you do a mongodump you can see it's type 6).

      ----------

      This causes problems with replication (i.e., stops it completely).

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            kristina Kristina Chodorow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: