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*

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix
9.1.0-rc09.1.0-rc10249.0.7
Components
Server components related to this issue

No components specified.

Labels
Tags and classification
bkp