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

mongo shell doesn't escape characters in strings correctly

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Works as Designed
    • None
    • None
    • Shell
    • None
    • mongo shell running under cygwin, although that shouldn't affect this
    • Fully Compatible
    • ALL

    Description

      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 '\'.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dan@mongodb.com Daniel Pasette
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: