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

Function makeMultiResponseBatchModelArray

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

Source from the content-addressed store, hash-verified

489}
490
491export async function makeMultiResponseBatchModelArray(
492 configuration: TestConfiguration
493): Promise<AnyClientBulkWriteModel<any>[]> {
494 const { maxBsonObjectSize } = await configuration.hello();
495 const namespace = `foo.${new BSON.ObjectId().toHexString()}`;
496 const models: AnyClientBulkWriteModel<any>[] = [
497 {
498 name: 'updateOne',
499 namespace,
500 update: { $set: { age: 1 } },
501 upsert: true,
502 filter: { _id: 'a'.repeat(maxBsonObjectSize / 2) }
503 },
504 {
505 name: 'updateOne',
506 namespace,
507 update: { $set: { age: 1 } },
508 upsert: true,
509 filter: { _id: 'b'.repeat(maxBsonObjectSize / 2) }
510 }
511 ];
512
513 return models;
514}
515
516export function fakeServer() {
517 return {

Callers 1

Calls 1

helloMethod · 0.45

Tested by

no test coverage detected