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

Method constructor

src/operations/update.ts:130–141  ·  src/operations/update.ts::UpdateOneOperation.constructor
(
    ns: MongoDBCollectionNamespace,
    filter: Document,
    update: Document,
    options: UpdateOptions
  )

Source from the content-addressed store, hash-verified

128/** @internal */
129export class UpdateOneOperation extends UpdateOperation {
130 constructor(
131 ns: MongoDBCollectionNamespace,
132 filter: Document,
133 update: Document,
134 options: UpdateOptions
135 ) {
136 super(ns, [makeUpdateStatement(filter, update, { ...options, multi: false })], options);
137
138 if (!hasAtomicOperators(update, options)) {
139 throw new MongoInvalidArgumentError(class="st">'Update document requires atomic operators');
140 }
141 }
142
143 override handleOk(
144 response: InstanceType<typeof this.SERVER_COMMAND_RESPONSE_TYPE>

Callers

nothing calls this directly

Calls 2

hasAtomicOperatorsFunction · 0.90
makeUpdateStatementFunction · 0.85

Tested by

no test coverage detected