mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-11 10:59:55 +08:00
Merge pull request #21314 from Joge97/master
[mongoose] Fix types for SchemaDefinition
This commit is contained in:
6
types/mongoose/index.d.ts
vendored
6
types/mongoose/index.d.ts
vendored
@@ -516,7 +516,7 @@ declare module "mongoose" {
|
||||
/** defaults to 1 */
|
||||
parallel?: number;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* section querycursor.js
|
||||
* http://mongoosejs.com/docs/api.html#querycursor-js
|
||||
@@ -807,7 +807,7 @@ declare module "mongoose" {
|
||||
* Intellisense for Schema definitions
|
||||
*/
|
||||
interface SchemaDefinition {
|
||||
[path: string]: SchemaTypeOpts<any>;
|
||||
[path: string]: SchemaTypeOpts<any> | Schema | SchemaType;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2723,7 +2723,7 @@ declare module "mongoose" {
|
||||
passRawResult?: boolean;
|
||||
/** overwrites the schema's strict mode option for this update */
|
||||
strict?: boolean;
|
||||
/**
|
||||
/**
|
||||
* if true, run all setters defined on the associated model's schema for all fields
|
||||
* defined in the query and the update.
|
||||
*/
|
||||
|
||||
@@ -368,8 +368,8 @@ new mongoose.Schema({d: {type: Date, min: [
|
||||
new mongoose.Schema({
|
||||
integerOnly: {
|
||||
type: Number,
|
||||
get: v => Math.round(v),
|
||||
set: v => Math.round(v)
|
||||
get: (v: number) => Math.round(v),
|
||||
set: (v: number) => Math.round(v)
|
||||
}
|
||||
});
|
||||
new mongoose.Schema({ name: { type: String, validate: [
|
||||
|
||||
Reference in New Issue
Block a user