Hm.. I thought
~= was defined for
Json, but for some reason I left it out in the initial commit of json.d. A workaround is of course to use an actual array:
Json arr; foreach( doc; coll.find() ) arr ~= doc.toJson(); auto json = Json(arr);
I'll look into why
~= is not defined.