fix(map): clean modified subpaths when overwriting values in map of subdocs#15114
fix(map): clean modified subpaths when overwriting values in map of subdocs#15114
Conversation
|
node_modules/mongoose/types/types.d.ts:63:83 - error TS2344: Type 'Subdocument<InferId, any, T> & T' does not satisfy the constraint 'Subdocument<any, any, any>'. 63 class DocumentArray<T, THydratedDocumentType extends Types.Subdocument = Types.Subdocument<InferId, any, T> & T> extends Types.Array { Getting this error, anyone else faced this issue ? |
|
@eldhoseelias likely not related to this PR, please search for or open a new issue / discussion. Also make sure you are on a new (or better latest) version of mongoose and typescript. |
Fix #15108
Summary
#15108 is due to Mongoose change tracking not cleaning up modified paths underneath maps of subdocs when overwriting the entire subdoc. So
doc.map.delete('subdoc')will still leave any subpaths ofmap.subdocmodified. This PR cleans up those paths.Examples