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

mongoexport escapes '/'s in strings

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.3.4
    • Affects Version/s: 1.3.3
    • Component/s: Tools
    • None
    • Environment:
      OS X

      Note the 'referrer' and useragent fields; in the strings '/'s are "escaped" with backslashes in the mongoexport output. I'm not sure if it's a feature, but if it is it seems like a bad one. If it's to support regular expressions, those should have a

      { $regexp: "/..../" }

      format or some such.

      db.results.find()

      { "_id" : ObjectId("4ade5e1b6fde954d5f9c633c"), "ipv64_ip" : "2001:1938:107:0:223:32ff:fed1:1ccc", "user-agent" : "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.4) Gecko/20091006 Firefox/3.5.4", "ipv6" : "551", "ipv4" : "248", "remote_ip" : "70.161.128.50", "time" : 1256087067, "version" : "1.02", "referrer" : "http://www6.ntppool.org/", "ipv64" : "572", "ipv6_ip" : "2001:1938:107:0:223:32ff:fed1:1ccc", "v6uq" : "092f1f47-b53d-4b03-8969-8a637ef0d2ff", "ipv4_ip" : "70.161.128.50" }

      [...]

      mongoexport output (of a similar entry):

      { "_id" :

      { "$oid" : "4add8563031f5a6944ae274f" }

      , "ipv4" : "3610", "ipv4_ip" : "...", "ipv6" : "error", "ipv64" : "594", "ipv64_ip" : "80.25.49.176", "referrer" : "http:\/\/www.pool.ntp.org\/", "remote_ip" : "...", "site" : "E7153D4C-22B2-11DF-AEA1-BF774E67F352", "time" : 1256031587, "user-agent" : "Mozilla\/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident\/4.0; Tablet PC 1.7; .NET CLR 1.0.3705; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)", "v6uq" : "b09b328b-4aee-4ee6-b429-5cd553081f16", "version" : "1.02" }

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            ask Ask Bjørn Hansen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: