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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Won't Fix
    • 1.6.5
    • None
    • JavaScript
    • None
    • osx x86_64 - mongodb 1.6.5
    • ALL

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: