DoctrineMongoDBBundle icon indicating copy to clipboard operation
DoctrineMongoDBBundle copied to clipboard

Profiler log output should use strict JSON representation for BSON types

Open jmikola opened this issue 12 years ago • 5 comments

From comment in #177:

I suppose the most preferable option would be to serialize the driver classes in the "strict JSON" format defined in: http://docs.mongodb.org/manual/reference/mongodb-extended-json/#data_binary (the mongoexport commands use that notation).

jmikola avatar Mar 18 '13 14:03 jmikola

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 21 '19 07:01 stale[bot]

@malarzm: It's been a while since I worked with the bundle, but are CommandDataCollector.php and PSRCommandLogger.php the only classes relevant to data collection and logging? The original classes mentioned in #177 no longer exist.

It looks like the current classes are using json_encode(), which addresses the original concern in #177 since binary data is displayed as base64-encoded. That said, the driver's JsonSerializable implementations on BSON types yields a legacy extended JSON format (vs. the formats outlined in the Extended JSON spec). If you think it's worth fixing that, I can submit a quick patch that round-trips the command documents through fromPHP() and toRelaxedExtendedJSON().

If not, feel free to close this as-is.

jmikola avatar Feb 05 '19 15:02 jmikola

@jmikola looking at Conversion table the relaxed format looks nice and if it's not a big hassle I'd say it's nice to have :)

malarzm avatar Feb 06 '19 22:02 malarzm

Let's try to get this done for 4.0 :)

alcaeus avatar Feb 07 '19 06:02 alcaeus

@alcaeus isn't it fixed in #652?

IonBazan avatar Sep 21 '21 08:09 IonBazan