← Back to team overview

maria-discuss team mailing list archive

Re: Restated: JSON cannot represent binary data

 

Hi guys
I will comment Justin Swanhart mail, that's reasonable

>>Hi,
>>I suggest creating an MDEV spec for COLUMN_BSON() to return BSON data
which can handle binary (MongoDB uses it to store binary data).

Nice, solve a binary representation problem, maybe we will need
BSON_TO_COLUMN and JSON_TO_COLUMN too


>>In the same MDEV, COLUMN_JSON should be modified to omit binary columns
and return a warning to use COLUMN_BSON for a complete representation of
the data.

I think we should extend the COLUMN_JSON function
instead of
COLUMN_JSON(  dyncol )

"we" could have:

COLUMN_JSON(  dyncol ,  binary_output )

at binary_output we explain how binary values will be returned:

'base64'  -> return as base64
'raw'  -> do what COLUMN_JSON do today
'buffer'  -> like node.js encoding binary as array [12,34,52,42,123, etc
...]
'null' -> return NULL

any binary_output 'conversion' should report a warning that we have 'binary
casting' with column_json function
or maybe, a warning to use column_bson function

References