Skip to content

Commit 48b12c3

Browse files
committed
chore: comments
1 parent e461f17 commit 48b12c3

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/collection.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,17 @@ export class Collection<TSchema extends Document = Document> {
172172
/** @internal */
173173
client: MongoClient;
174174

175+
/**
176+
* Get the database object for the collection.
177+
*/
178+
readonly db: Db;
179+
175180
/**
176181
* Create a new Collection instance
177182
* @internal
178183
*/
179184
constructor(db: Db, name: string, options?: CollectionOptions) {
185+
this.db = db;
180186
// Internal state
181187
this.s = {
182188
db,
@@ -192,13 +198,6 @@ export class Collection<TSchema extends Document = Document> {
192198
this.client = db.client;
193199
}
194200

195-
/**
196-
* Get the database object for the collection.
197-
*/
198-
get db(): Db {
199-
return this.s.db;
200-
}
201-
202201
/**
203202
* The name of the database this collection belongs to
204203
*/

src/db.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ export class Db {
126126
/** @internal */
127127
s: DbPrivate;
128128

129-
/** @public */
129+
/**
130+
* Gets the MongoClient associated with the Db.
131+
* @public
132+
*/
130133
readonly client: MongoClient;
131134

132135
public static SYSTEM_NAMESPACE_COLLECTION = CONSTANTS.SYSTEM_NAMESPACE_COLLECTION;

0 commit comments

Comments
 (0)