Skip to content

Commit

Permalink
Fix problem when deleting an entry on a populated Map
Browse files Browse the repository at this point in the history
  • Loading branch information
futurliberta committed Jun 8, 2024
1 parent c71ba5e commit 5e4023f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/types/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class MongooseMap extends Map {
v.$__.wasPopulated = { value: v._id };
return v;
});
} else {
} else if (value) { // Fix when using delete method because the value is undefined
if (value.$__ == null) {
value = new populated.options[populateModelSymbol](value);
}
Expand Down

0 comments on commit 5e4023f

Please sign in to comment.