[SERVER-2103] Go over BSONObj toString and jsonString Created: 16/Nov/10  Updated: 05/Apr/17  Resolved: 24/May/16

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

Type: Task Priority: Major - P3
Reporter: Mathias Stearn Assignee: Mira Carey
Resolution: Won't Fix Votes: 0
Labels: cxxcopy
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Platforms 15 (06/03/16)
Participants:

 Description   

Need to make sure everything is round-trippable by copying to shell



 Comments   
Comment by Mira Carey [ 24/May/16 ]

After some reflection, I don't think we actually need/want to make BSONObj::toString() eval-able in the shell. Closing this general ticket as wontfix

Comment by Mathias Stearn [ 20/May/16 ]

At the time this was filed, the idea was we wanted the shell to be able to parse the output of BSONObj::toString(). I think the only case that isn't today is Timestamp, but it is probably worth double checking. Also, I'm not sure if that is actually a goal anymore.

Comment by Tyler Brock [ 03/Jul/14 ]

redbeard0531, do you think our recent changes in SERVER-14357 satisfy your/aaron's concerns or were there other things you wanted to look at?

Comment by Aaron Staple [ 03/Jan/12 ]

One thing that might be wrong is it looks like empty arrays can be stringified as objects:

    inline string BSONObj::toString( bool isArray, bool full ) const {
        if ( isEmpty() ) return "{}";
        StringBuilder s;
        toString(s, isArray, full);
        return s.str();
    }
    inline void BSONObj::toString(StringBuilder& s,  bool isArray, bool full ) const {
        if ( isEmpty() ) {
            s << "{}";
            return;
        }

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