mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 07:40:10 +00:00
[@types/mongoose] Add missing autoCreate?: boolean to ConnectionOptions type (#37853)
* Add autocreate to ConnectionOptions https://mongoosejs.com/docs/guide.html#autoCreate was not included in types for Mongoose * Update mongoose-tests.ts * Update mongoose-tests.ts * Update index.d.ts
This commit is contained in:
6
types/mongoose/index.d.ts
vendored
6
types/mongoose/index.d.ts
vendored
@@ -28,6 +28,7 @@
|
||||
// Richard Davison <https://github.com/richarddd>
|
||||
// Brian Chen <https://github.com/ToucheSir>
|
||||
// Boris Figovsky <https://github.com/borfig>
|
||||
// Simon Driscoll <https://github.com/dinodeSimon>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -336,6 +337,11 @@ declare module "mongoose" {
|
||||
};
|
||||
autoIndex?: boolean;
|
||||
|
||||
/** Before Mongoose builds indexes, it calls Model.createCollection()
|
||||
* to create the underlying collection in MongoDB if autoCreate
|
||||
* is set to true.(default: false) */
|
||||
autoCreate?: boolean;
|
||||
|
||||
/** Specify a journal write concern (default: false). */
|
||||
journal?: boolean;
|
||||
|
||||
|
||||
@@ -28,7 +28,8 @@ const connection2: Promise<mongoose.Mongoose> = mongoose.connect(connectUri, {
|
||||
useNewUrlParser: true,
|
||||
useFindAndModify: true,
|
||||
useCreateIndex: true,
|
||||
autoIndex: true
|
||||
autoIndex: true,
|
||||
autoCreate: true,
|
||||
});
|
||||
const connection3 = mongoose.connect(connectUri, function (error) {
|
||||
error.stack;
|
||||
|
||||
Reference in New Issue
Block a user