Merge pull request #23628 from ethanresnick/mongoose-patch

Mongoose: fix model.baseModelName
This commit is contained in:
Benjamin Lichtman
2018-02-26 09:37:56 -08:00
committed by GitHub
4 changed files with 11 additions and 5 deletions

View File

@@ -1,6 +1,12 @@
// Type definitions for Mongoose 5.0.1
// Project: http://mongoosejs.com/
// Definitions by: simonxca <https://github.com/simonxca>, horiuchi <https://github.com/horiuchi>, sindrenm <https://github.com/sindrenm>, lukasz-zak <https://github.com/lukasz-zak>, Alorel <https://github.com/Alorel>, jendrikw <https://github.com/jendrikw>
// Definitions by: simonxca <https://github.com/simonxca>
// horiuchi <https://github.com/horiuchi>
// sindrenm <https://github.com/sindrenm>
// lukasz-zak <https://github.com/lukasz-zak>
// Alorel <https://github.com/Alorel>
// jendrikw <https://github.com/jendrikw>
// Ethan Resnick <https://github.com/ethanresnick>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -2712,7 +2718,7 @@ declare module "mongoose" {
* If this is a discriminator model, baseModelName is the
* name of the base model.
*/
baseModelName: String;
baseModelName: string | undefined;
/** Collection the model uses. */
collection: Collection;

View File

@@ -1479,7 +1479,7 @@ MongoModel.update({ name: 'Tobi' }, { ferret: true }, { multi: true }, cb);
MongoModel.where('age').gte(21).lte(65).exec(cb);
MongoModel.where('age').gte(21).lte(65).where('name', /^b/i);
new (mongoModel.base.model(''))();
mongoModel.baseModelName.toLowerCase();
mongoModel.baseModelName && mongoModel.baseModelName.toLowerCase();
mongoModel.collection.$format(99);
mongoModel.collection.initializeOrderedBulkOp;
mongoModel.collection.findOne;

View File

@@ -2730,7 +2730,7 @@ declare module "mongoose" {
* If this is a discriminator model, baseModelName is the
* name of the base model.
*/
baseModelName: String;
baseModelName: string | undefined;
/** Collection the model uses. */
collection: Collection;

View File

@@ -1471,7 +1471,7 @@ MongoModel.update({ name: 'Tobi' }, { ferret: true }, { multi: true }, cb);
MongoModel.where('age').gte(21).lte(65).exec(cb);
MongoModel.where('age').gte(21).lte(65).where('name', /^b/i);
new (mongoModel.base.model(''))();
mongoModel.baseModelName.toLowerCase();
mongoModel.baseModelName && mongoModel.baseModelName.toLowerCase();
mongoModel.collection.$format(99);
mongoModel.collection.initializeOrderedBulkOp;
mongoModel.collection.findOne;