MCPcopy
hub / github.com/mongodb/node-mongodb-native / makeMultiBatchWrite

Function makeMultiBatchWrite

test/tools/utils.ts:476–489  ·  view source on GitHub ↗
(
  configuration: TestConfiguration
)

Source from the content-addressed store, hash-verified

474}
475
476export async function makeMultiBatchWrite(
477 configuration: TestConfiguration
478): Promise<AnyClientBulkWriteModel<any>[]> {
479 const { maxBsonObjectSize, maxMessageSizeBytes } = await configuration.hello();
480
481 const length = maxMessageSizeBytes / maxBsonObjectSize + 1;
482 const models = Array.from({ length }, () => ({
483 namespace: 'db.coll',
484 name: 'insertOne' as const,
485 document: { a: 'b'.repeat(maxBsonObjectSize - 500) }
486 }));
487
488 return models;
489}
490
491export async function makeMultiResponseBatchModelArray(
492 configuration: TestConfiguration

Calls 1

helloMethod · 0.45

Tested by

no test coverage detected