From 4278ade4c06e39d0002d2cac8b6dbf90d536c3f4 Mon Sep 17 00:00:00 2001 From: Olga Isakova Date: Mon, 25 Feb 2019 01:39:24 +0500 Subject: [PATCH] Add schema options: selectPopulatedPaths, storeSubdocValidationError --- types/mongoose/index.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 267163ac80..16e6d88715 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -18,6 +18,7 @@ // Emmanuel Gautier // Frontend Monster // Ming Chen +// Olga Isakova // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -1060,12 +1061,25 @@ declare module "mongoose" { validateBeforeSave?: boolean; /** defaults to "__v" */ versionKey?: string | boolean; + /** + * By default, Mongoose will automatically + * select() any populated paths. + * To opt out, set selectPopulatedPaths to false. + */ + selectPopulatedPaths?: boolean; /** * skipVersioning allows excluding paths from * versioning (the internal revision will not be * incremented even if these paths are updated). */ skipVersioning?: any; + /** + * Validation errors in a single nested schema are reported + * both on the child and on the parent schema. + * Set storeSubdocValidationError to false on the child schema + * to make Mongoose only report the parent error. + */ + storeSubdocValidationError?: boolean; /** * If set timestamps, mongoose assigns createdAt * and updatedAt fields to your schema, the type