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

10gen custom types not defined in Spidermonkey mapReduce context or $where query context

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • ALL

    Description

      Example in mapReduce context:

      > db.mr.mapReduce(function() { emit("test",ObjectId()) }, function ( k , v ) { return { test : ObjectId() } }, { out : "mr_out" })
      Tue Mar 12 19:17:34.004 [conn1] CMD: drop test.tmp.mr.mr_0
      Tue Mar 12 19:17:34.004 [conn1] CMD: drop test.tmp.mr.mr_0_inc
      Tue Mar 12 19:17:34.005 [conn1] build index test.tmp.mr.mr_0_inc { 0: 1 }
      Tue Mar 12 19:17:34.006 [conn1] build index done.  scanned 0 total records. 0.001 secs
      Tue Mar 12 19:17:34.006 [conn1] build index test.tmp.mr.mr_0 { _id: 1 }
      Tue Mar 12 19:17:34.007 [conn1] build index done.  scanned 0 total records. 0 secs
      Tue Mar 12 19:17:34.007 [conn1] JS Error: ReferenceError: ObjectId is not defined nofile_b:1
      Tue Mar 12 19:17:34.009 [conn1] CMD: drop test.tmp.mr.mr_0
      Tue Mar 12 19:17:34.010 [conn1] CMD: drop test.tmp.mr.mr_0_inc
      Tue Mar 12 19:17:34.010 [conn1] mr failed, removing collection :: caused by :: 9014 map invoke failed: JS Error: ReferenceError: ObjectId is not defined nofile_b:1
      Tue Mar 12 19:17:34.011 [conn1] CMD: drop test.tmp.mr.mr_0
      Tue Mar 12 19:17:34.011 [conn1] CMD: drop test.tmp.mr.mr_0_inc
      Tue Mar 12 19:17:34.013 uncaught exception: map reduce failed:{
      	"errmsg" : "exception: map invoke failed: JS Error: ReferenceError: ObjectId is not defined nofile_b:1",
      	"code" : 9014,
      	"ok" : 0
      }
      >

      Example in $where context:

      > db.test.find({$where:"this.x==ObjectId()"})
      Tue Mar 12 19:19:45.666 [conn1] JS Error: ReferenceError: ObjectId is not defined nofile_a:0
      Tue Mar 12 19:19:45.666 [conn1] assertion 10071 error on invocation of $where function:
      JS Error: ReferenceError: ObjectId is not defined nofile_a:0 ns:test.test query:{ $where: "this.x==ObjectId()" }
      error: {
      	"$err" : "error on invocation of $where function:\nJS Error: ReferenceError: ObjectId is not defined nofile_a:0",
      	"code" : 10071
      }
      >

      Also a problem with DBRef, DBPointer, BinData, and Timestamp

      Attachments

        Activity

          People

            sverch Shaun Verch
            sverch Shaun Verch
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: