Skip to content
Merged
Changes from all commits
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
4 changes: 4 additions & 0 deletions types/connection.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,15 @@ declare module 'mongoose' {
}[keyof SchemaMap];

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

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

/** The Mongoose instance this connection is associated with */
base: Mongoose;

bulkWrite<TSchemaMap extends Record<string, AnyObject>>(
ops: Array<ConnectionBulkWriteModel<TSchemaMap>>,
options: mongodb.ClientBulkWriteOptions & { ordered: false }
Expand Down