@@ -129,7 +129,6 @@ export interface CollectionOptions extends BSONSerializeOptions, WriteConcernOpt
129129/** @internal */
130130export interface CollectionPrivate {
131131 pkFactory : PkFactory ;
132- db : Db ;
133132 options : any ;
134133 namespace : MongoDBCollectionNamespace ;
135134 readPreference ?: ReadPreference ;
@@ -185,7 +184,6 @@ export class Collection<TSchema extends Document = Document> {
185184 this . db = db ;
186185 // Internal state
187186 this . s = {
188- db,
189187 options,
190188 namespace : new MongoDBCollectionNamespace ( db . databaseName , name ) ,
191189 pkFactory : db . options ?. pkFactory ?? DEFAULT_PK_FACTORY ,
@@ -234,7 +232,7 @@ export class Collection<TSchema extends Document = Document> {
234232 */
235233 get readConcern ( ) : ReadConcern | undefined {
236234 if ( this . s . readConcern == null ) {
237- return this . s . db . readConcern ;
235+ return this . db . readConcern ;
238236 }
239237 return this . s . readConcern ;
240238 }
@@ -245,7 +243,7 @@ export class Collection<TSchema extends Document = Document> {
245243 */
246244 get readPreference ( ) : ReadPreference | undefined {
247245 if ( this . s . readPreference == null ) {
248- return this . s . db . readPreference ;
246+ return this . db . readPreference ;
249247 }
250248
251249 return this . s . readPreference ;
@@ -261,7 +259,7 @@ export class Collection<TSchema extends Document = Document> {
261259 */
262260 get writeConcern ( ) : WriteConcern | undefined {
263261 if ( this . s . writeConcern == null ) {
264- return this . s . db . writeConcern ;
262+ return this . db . writeConcern ;
265263 }
266264 return this . s . writeConcern ;
267265 }
@@ -515,7 +513,7 @@ export class Collection<TSchema extends Document = Document> {
515513 * @param options - Optional settings for the command
516514 */
517515 async drop ( options ?: DropCollectionOptions ) : Promise < boolean > {
518- return await this . s . db . dropCollection ( this . collectionName , options ) ;
516+ return await this . db . dropCollection ( this . collectionName , options ) ;
519517 }
520518
521519 /**
@@ -584,7 +582,7 @@ export class Collection<TSchema extends Document = Document> {
584582 */
585583 async options ( options ?: OperationOptions ) : Promise < Document > {
586584 options = resolveOptions ( this , options ) ;
587- const [ collection ] = await this . s . db
585+ const [ collection ] = await this . db
588586 . listCollections ( { name : this . collectionName } , { ...options , nameOnly : false } )
589587 . toArray ( ) ;
590588
0 commit comments