jstests/aggregation/expressions/bsonSize.js
// bsonSize's argument must be a document
bsonSize's argument must be a document
bsonSize ' s argument must be a document
function checkExpectsDocument(badInput) {
    assert.throws(() => coll.aggregate([{$project: {x: {$bsonSize: {$literal: badInput}}}}]),
                  [],
                  "$bsonSize requires a document input");
}
function checkExpectsDocument ( badInput ) { assert . throws ( ( ) => coll . aggregate ( [ { $project : { x : { $bsonSize : { $literal : badInput } } } } ] ) , [ ] , "$bsonSize requires a document input" ) ; }
bsonSize's argument must be a document
bsonSize ' s argument must be a document