[SERVER-481] C++ driver does not output valid JSON when calling toString() Created: 13/Dec/09  Updated: 15/Jan/10  Resolved: 13/Dec/09

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: 1.3.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Raj Kadam Assignee: Eliot Horowitz (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Given these fields:

title: Keri Hilson ft. Kanye West & Ne-Yo "Knock You Down"
views: 9

Inserting them into a mongo::BSONObjBuilder object and then call toString() gets you:

{ title: "Keri Hilson ft. Kanye West & Ne-Yo "Knock You Down"", views: 9}

it should be:

{ title: "Keri Hilson ft. Kanye West & Ne-Yo \"Knock You Down\"", views: 9}

 Comments   
Comment by Eliot Horowitz (Inactive) [ 13/Dec/09 ]

toString is supposed to fast, not accurate json
should use jsonString for that

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