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

Map/Reduce, emit() should not allow undefined as key

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: 2.0.6
    • Component/s: MapReduce
    • Environment:
      OSX (not sure if that's relevant)
    • Query Optimization

      The map function allows emit() to emit an undefined value for the key.

      When many such emits occur, the reduce step will fail complaining that the value is too large to reduce.

      I can't see a situation where I would ever want to allow a key to be undefined, so I would like emit to throw an exception on the emit(). If changing the default behavior is undesirable, some sort of 'strict' flag that enforced this would be nice.

      Personally, I ran into this because I ran a new M/R against an old collection. I don't see it as a big deal for production systems, but at least the option to fail fast might speed up the development cycle.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            andydavis Andy Davis
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: