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

Array.sum doesn't work in final reduce

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.6
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • ALL

      > function map()

      { emit('count', 1); }

      > function reduce(key, values)

      { return Array.sum(values) }

      > out = db.foo.mapReduce(map, reduce)
      Mon Jul 12 13:20:06 uncaught exception: map reduce failed: {
      "ok" : 0,
      "errmsg" : "final reduce failed:

      { result: \"tmp.mr.mapreduce_1278955206_2\", assertion: \"invoke failed: JS Error: TypeError: Array.sum is not a function nofile_b:1\", assertionCode: 9004, errmsg: \"db assertion failure\", ok: 0.0 }

      "
      }

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: