[SERVER-6893] Shell tojson() shouldn't compact multiple adjacent spaces to one. Created: 29/Aug/12  Updated: 21/Aug/13  Resolved: 21/Aug/13

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Unassigned
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-7424 Shell trims multiple whitespace chara... Closed
Operating System: ALL
Participants:

 Description   

> tojson({withSpaces: '1 2  3   done'})
{ "withSpaces" : "1 2 3 done" }

Here is the broken code: https://github.com/mongodb/mongo/blob/f876d2d71a7c238889c222164571a9e7170ec080/src/mongo/shell/utils.js#L978

Based on the blame, it looks like we've been doing this basically forever.



 Comments   
Comment by Tad Marshall [ 20/Aug/13 ]

This was fixed as SERVER-7424 for 2.5.0, and backported to 2.4.4.

Comment by Gianfranco Palumbo [ 20/Aug/13 ]

Fixed found in 2.4.5

> tojson({withSpaces: '1 2  3   done'})
{ "withSpaces" : "1 2  3   done" }

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