From d512b1f5d139c64bf413e2df6a659f8dfb86219a Mon Sep 17 00:00:00 2001 From: Andrew Stiegmann Date: Fri, 19 Jan 2018 08:15:29 -1000 Subject: [PATCH] Add `usePushEach` flag to Mongoose Schema Options (#23042) In order for devs to be able to work around the issues described in https://github.com/Automattic/mongoose/issues/5574 we need to be able to supply the `usePushEach` flag to the Mongoose SchemaOptions. This options functionality is described in https://github.com/Automattic/mongoose/issues/4455 and is required for anyone who modifies arrays inline who is using Mongoose 4 and MongoDB 3.6+ Testing: Copied changes to local project and verified compilation worked. --- types/mongoose/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 3e676b499f..ee703de783 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -815,6 +815,8 @@ declare module "mongoose" { typeKey?: string; /** defaults to false */ useNestedStrict?: boolean; + /** defaults to false */ + usePushEach?: boolean; /** defaults to true */ validateBeforeSave?: boolean; /** defaults to "__v" */