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

db object no longer available to mapper

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 2.4.1
    • Component/s: MapReduce
    • None
    • Environment:
    • ALL
    • Hide

      > db.mrtest.save(

      {a:1,b:1}

      )
      > db.other.save(

      {x:1,y:1}

      )

      > m = function ()

      { db.other.findOne(); }

      > r = function (k,vaks) { }

      > db.mrtest.mapReduce(m, r, 'mrout')
      Thu Apr 4 13:58:35.888 JavaScript execution failed: map reduce failed:{
      "errmsg" : "exception: JavaScript execution failed: ReferenceError: db is not defined near 'tion () { db.other.fi' ",
      "code" : 16722,
      "ok" : 0
      } at src/mongo/shell/collection.js:L970

      Show
      > db.mrtest.save( {a:1,b:1} ) > db.other.save( {x:1,y:1} ) > m = function () { db.other.findOne(); } > r = function (k,vaks) { } > db.mrtest.mapReduce(m, r, 'mrout') Thu Apr 4 13:58:35.888 JavaScript execution failed: map reduce failed:{ "errmsg" : "exception: JavaScript execution failed: ReferenceError: db is not defined near 'tion () { db.other.fi' ", "code" : 16722, "ok" : 0 } at src/mongo/shell/collection.js:L970

      Referencing db in a mapper now raises an exception. The previous version I used 2.2.3 didn't do this.

      We rely on this to pull in extra document into when performing map reduces.

      A similar change happened some time ago, where the db object was no longer available to finalizers (even though the documentation implied this was valid).

            Assignee:
            Unassigned Unassigned
            Reporter:
            crudson Doug Hudson
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: