Wrapping an array in a hash adds some mild overhead, but otherwise should work. Unfortunately, for historical reasons, the spec for arrays in BSON is horribly inefficient (index-value pairs!) so I would not recommend it for storing large arrays.
I have been considering supporting a TO_BSON method (or even just using TO_JSON, but don't want to do that until I have a broader think about the general case of mappings to and from BSON. (If you think about how JSON::XS is using Types::Serialiser, you can see the general case problem.)
-xdg
In reply to Re^5: Serialise to binary?
by xdg
in thread Serialise to binary?
by sectokia
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |