On Tue, 29 Apr 2014 10:35:25 GMT, Chris Rays wrote:

This used to work with the old serializeToBson:

Bson q = Bson(["UID" : Bson("STR-UID"), "Version" : Bson(1)]);

auto bf = cast(ubyte[])std.file.read("bin.obj");
Bson bt = serializeToBson(bf);

q["DATA"] = bt;


With the new serializeToBson it fails:

Internal error information:
core.exception.AssertError@....\Users\cducree\AppData\Roaming\dub\packages\vibe-d-0.7.19\source\vibe\data\bson.d(1323): Overwriting root item.

How to serialize ubyte arrays to Bson?

That's a bug in the new implementation, which apparently didn't get caught by the existing unit tests. I've fixed it now in bea1ac0, so the options are now to either use the ~master version of vibe.d or to define "versions": ["VibeOldSerialization"] to use the old code (which doesn't support all the new features, such as the various @attributes).