mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 19:43:20 +08:00
Merge pull request #23628 from ethanresnick/mongoose-patch
Mongoose: fix model.baseModelName
This commit is contained in:
10
types/mongoose/index.d.ts
vendored
10
types/mongoose/index.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
2
types/mongoose/v4/index.d.ts
vendored
2
types/mongoose/v4/index.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user