SERVER-135206ClosedFixed
$convert to binData fails on a document of exactly BSONObjMaxUserSize because RCString rejects the boundary size
h2. Problem A document whose BSON size is exactly {{BSONObjMaxUserSize}} (16777216 bytes) is a legal stored document, but it cannot be materialized as a {{Value}} of type BinData, because {{RCString::create()}} uses a *strict* {{<}} against {{BSONObjMaxUserSize}}: BinData values are stored through this path ({{value_internal.h:283}}), so {{$convert: {input: "$$ROOT", to: "binData"}}} on a maximally-sized document fails with: The two boundary conventions disagree: documents are valid *at*