Moves to canonical extended JSON output#147
Conversation
|
Hmm I really don't like that the new spec wraps every integer and number is now wrapped in another object. This creates a lot of overhead, and in R we rarely distinguish these types. "Int32": {
"$numberInt": "42"
},
"Int64": {
"$numberLong": "42"
},
"Double": {
"$numberDouble": "42.42"
},If we switch I think I would prefer the 'relaxed' extended json. |
|
Do you mean in terms of the R objects generated? If so, I definitely favour efficiency. Otherwise I think this change only applies to generating JSON strings -- and there it might make more sense to favour correctness. |
Signed-off-by: Aaron Jacobs <aaron.jacobs@crescendotechnology.com>
d558ac0 to
46f1592
Compare
|
I really don't like how inserting some data from R and then exporting it blows up the json because each value is wrapped in Generally I don't think R users care about this. In R all numbers get silently coerced to doubles. Hence I prefer the "relaxed" format which I think is more in line with the R philosophy. |
|
Makes sense to me. 👍 |
As discussed in jeroen/jsonlite#247,
mongoliteis currently producing so-called "legacy" extended JSON in some places. This commit moves existing uses ofbson_as_json()tobson_as_canonical_extended_json()in an effort to resolve this.