|
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
|
|
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.
|
|
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?
|
|
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.