mongo shell doesn't escape characters in strings correctly

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Shell
    • None
    • Environment:
      mongo shell running under cygwin, although that shouldn't affect this
    • Fully Compatible
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Tried the following in the mongo shell

      > use foo
      switched to db foo
      > db.f.save(

      {"name":"c:\a\b\c"}

      );
      > db.f.save(

      {"name":"c:\\a\\b\\c"}

      );
      > db.f.find();

      { "_id" : ObjectId("4edd38551252ee52efdc0ed3"), "name" : "c:a\bc" } { "_id" : ObjectId("4edd38621252ee52efdc0ed4"), "name" : "c:\\a\\b\\c" }

      >

      The handling of backslashes within strings does not seem to be consistent. The first example removes some of them without doing anything to the following characters. The second example fails to use "
      " as an escape for '\'.

              Assignee:
              Unassigned
              Reporter:
              Daniel Pasette (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: