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

XMLWordPrintableJSON

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

      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
              Reporter:
              Sandro Munda
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: