You cannot use JSON_AGG or JSON_COMPOSE to publish data to the BSON or UBJSON format. To publish data in one of these binary formats, you can use JSON_AGG and/or JSON_COMPOSE to create a JSON document, and then convert that document to BSON or UBJSON using a cast expression or the AsBSON method.