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

mongo shell doesn't escape characters in strings correctly

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 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

      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 Unassigned
            Reporter:
            dan@mongodb.com Daniel Pasette (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: