Skip to content

Commit 6be3ae0

Browse files
authored
Merge pull request #15544 from Automattic/vkarpov15/base-type
types(connection): add `base` to connection type
2 parents 6e7f825 + 145a790 commit 6be3ae0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

types/connection.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,15 @@ declare module 'mongoose' {
7272
}[keyof SchemaMap];
7373

7474
class Connection extends events.EventEmitter implements SessionStarter {
75+
/** Runs a [db-level aggregate()](https://www.mongodb.com/docs/manual/reference/method/db.aggregate/) on this connection's underlying `db` */
7576
aggregate<ResultType = unknown>(pipeline?: PipelineStage[] | null, options?: AggregateOptions): Aggregate<Array<ResultType>>;
7677

7778
/** Returns a promise that resolves when this connection successfully connects to MongoDB */
7879
asPromise(): Promise<this>;
7980

81+
/** The Mongoose instance this connection is associated with */
82+
base: Mongoose;
83+
8084
bulkWrite<TSchemaMap extends Record<string, AnyObject>>(
8185
ops: Array<ConnectionBulkWriteModel<TSchemaMap>>,
8286
options: mongodb.ClientBulkWriteOptions & { ordered: false }

0 commit comments

Comments
 (0)