diff --git a/test/types/connection.test.ts b/test/types/connection.test.ts index 01e42bec123..93c3fc6c0d8 100644 --- a/test/types/connection.test.ts +++ b/test/types/connection.test.ts @@ -20,6 +20,10 @@ conn.readyState === 99; expectError(conn.readyState = 0); +expectType>>>( + conn.createCollections() +); + expectType(new Connection()); expectType>(new Connection().asPromise()); diff --git a/types/connection.d.ts b/types/connection.d.ts index a4f0f23eb8f..35714b13c8d 100644 --- a/types/connection.d.ts +++ b/types/connection.d.ts @@ -81,6 +81,11 @@ declare module 'mongoose' { */ createCollection(name: string, options?: mongodb.CreateCollectionOptions): Promise>; + /** + * https://mongoosejs.com/docs/api/connection.html#Connection.prototype.createCollections() + */ + createCollections(continueOnError?: boolean): Promise>>; + /** * Removes the model named `name` from this connection, if it exists. You can * use this function to clean up any models you created in your tests to