Describe the bug
// resets the addresses collection to a single item
wrap(user).assign({ addresses: [new Address(...)] });
this will insert new items before, and delete old items after, if the has unique index, the may throw conflict error
Expected behavior
delete old items first, and insert new items after
Versions
| Dependency |
Version |
| node |
v16.14.0 |
| typescript |
4.3.5 |
| mikro-orm |
5.6.14 |
| your-driver |
mysql |
Describe the bug
// resets the addresses collection to a single item
wrap(user).assign({ addresses: [new Address(...)] });
this will insert new items before, and delete old items after, if the has unique index, the may throw conflict error
Expected behavior
delete old items first, and insert new items after
Versions