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

Map reduce failed with special character (utf-8) and a pipe ( | )

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.6.5
    • Component/s: JavaScript
    • Labels:
      None
    • Environment:
      osx x86_64 - mongodb 1.6.5
    • ALL

      Hi,

      I just want to use the map reduce function of MongoDB. So I wrote a simple map_index function in javascript :

      function map_index()
      {
      var _translit = [
      [/ä|æ/g, 'ae'],
      ];
      ...
      ...
      ...

      After that, I try to load the file (index.js) into Mongo Shell and :

      > load('index.js');
      map reduce failed: {
      "assertion" : "map compile failed: JS Error: SyntaxError: unterminated regular expression literal nofile_b:1",
      "assertionCode" : 9012,
      "errmsg" : "db assertion failure",
      "ok" : 0
      }

      There is no problem if I remove "| æ".

      var _translit = [
      [/ä/g, 'ae'],
      ];

      The same behavior when I remove "ä" and keep "æ".

      Of course, the file is encoded in utf-8. Full test code can be found as Attachment.

            Assignee:
            Unassigned Unassigned
            Reporter:
            seyz Sandro Munda
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: