Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ export class Collection<TSchema extends Document = Document> {
this.client = db.client;
}

/**
* Get the database object for the collection.
*/
get db(): Db {
return this.s.db;
}

/**
* The name of the database this collection belongs to
*/
Expand Down
2 changes: 1 addition & 1 deletion src/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class Db {
/** @internal */
s: DbPrivate;

/** @internal */
/** @public */
readonly client: MongoClient;

public static SYSTEM_NAMESPACE_COLLECTION = CONSTANTS.SYSTEM_NAMESPACE_COLLECTION;
Expand Down