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

Method buildCommandDocument

src/operations/rename.ts:42–53  ·  view source on GitHub ↗
(_connection: Connection, _session?: ClientSession)

Source from the content-addressed store, hash-verified

40 }
41
42 override buildCommandDocument(_connection: Connection, _session?: ClientSession): Document {
43 const renameCollection = this.collection.namespace;
44 const to = this.collection.s.namespace.withCollection(this.newName).toString();
45 const dropTarget =
46 typeof this.options.dropTarget === 'boolean' ? this.options.dropTarget : false;
47
48 return {
49 renameCollection,
50 to,
51 dropTarget
52 };
53 }
54
55 override handleOk(_response: InstanceType<typeof this.SERVER_COMMAND_RESPONSE_TYPE>): Document {
56 return new Collection(this.collection.db, this.newName, this.collection.s.options);

Callers

nothing calls this directly

Calls 2

withCollectionMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected