* Create a new Collection instance * @internal
(db: Db, name: string, options?: CollectionOptions)
| 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 |
nothing calls this directly
no test coverage detected