[SERVER-713] mongoexport escapes '/'s in strings Created: 07/Mar/10  Updated: 12/Jul/16  Resolved: 08/Mar/10

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: 1.3.3
Fix Version/s: 1.3.4

Type: Bug Priority: Minor - P4
Reporter: Ask Bjørn Hansen Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS X


Participants:

 Description   

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" }



 Comments   
Comment by auto [ 08/Mar/10 ]

Author:

{'login': '', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: Don't escape '/' in JSON strings SERVER-713
http://github.com/mongodb/mongo/commit/ddc9397431f5ece23bfe670752894aa0aae10885

Generated at Thu Feb 08 02:54:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.