Throw an explicit error when asStream is used with bulk helper (#2078)

This commit is contained in:
Josh Mock
2023-11-16 10:14:20 -06:00
committed by GitHub
parent b7b16d81ee
commit 426919709f
2 changed files with 34 additions and 0 deletions

View File

@ -527,6 +527,8 @@ export default class Helpers {
* @return {object} The possible operations to run with the datasource.
*/
bulk<TDocument = unknown> (options: BulkHelperOptions<TDocument>, reqOptions: TransportRequestOptions = {}): BulkHelper<TDocument> {
assert(!(reqOptions.asStream ?? false), 'bulk helper: the asStream request option is not supported')
const client = this[kClient]
const { serializer } = client
if (this[kMetaHeader] !== null) {