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

Method constructor

src/collection.ts:184–199  ·  view source on GitHub ↗

* Create a new Collection instance * @internal

(db: Db, name: string, options?: CollectionOptions)

Source from the content-addressed store, hash-verified

182 * @internal
183 */
184 constructor(db: Db, name: string, options?: CollectionOptions) {
185 this.db = db;
186 // Internal state
187 this.s = {
188 db,
189 options,
190 namespace: new MongoDBCollectionNamespace(db.databaseName, name),
191 pkFactory: db.options?.pkFactory ?? DEFAULT_PK_FACTORY,
192 readPreference: ReadPreference.fromOptions(options),
193 bsonOptions: resolveBSONOptions(options, db),
194 readConcern: ReadConcern.fromOptions(options),
195 writeConcern: WriteConcern.fromOptions(options)
196 };
197
198 this.client = db.client;
199 }
200
201 /**
202 * The name of the database this collection belongs to

Callers

nothing calls this directly

Calls 2

resolveBSONOptionsFunction · 0.90
fromOptionsMethod · 0.45

Tested by

no test coverage detected