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

Method constructor

src/operations/update.ts:219–230  ·  src/operations/update.ts::ReplaceOneOperation.constructor
(
    ns: MongoDBCollectionNamespace,
    filter: Document,
    replacement: Document,
    options: ReplaceOptions
  )

Source from the content-addressed store, hash-verified

217/** @internal */
218export class ReplaceOneOperation extends UpdateOperation {
219 constructor(
220 ns: MongoDBCollectionNamespace,
221 filter: Document,
222 replacement: Document,
223 options: ReplaceOptions
224 ) {
225 super(ns, [makeUpdateStatement(filter, replacement, { ...options, multi: false })], options);
226
227 if (hasAtomicOperators(replacement)) {
228 throw new MongoInvalidArgumentError(class="st">'Replacement document must not contain atomic operators');
229 }
230 }
231
232 override handleOk(
233 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