Merge pull request #21314 from Joge97/master

[mongoose] Fix types for SchemaDefinition
This commit is contained in:
Nathan Shively-Sanders
2017-11-13 15:33:07 -08:00
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -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.
*/

View File

@@ -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: [