-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Proposal
In the Notes section of the BSON spec the seventh bullet described BinData. The third sub-bullet describes the user-defined type, "\x80-\xFF "User defined" subtypes. The binary data can be anything."
Our implementation limits this to only 0x80 and throws and error on other subtypes.
I propose that the UserDefined type be redefined to include a Word8 subtype field and that accompanying changes be made to the binary get and put functions.
data UserDefined = UserDefined Word8 ByteString
Use Case
The BSON format while more compact than JSON is still a rather verbose document particularly with the way it encodes arrays. I would like to leverage the UserDefined binary part of the spec to store packed vectors of data. Using the subtype field would allow me to identify what was in the packed date without having to use a separate field of tag.