Closed martinmicunda closed 7 months ago
Depends on your settings of partial. If partial is true (the default now), it updates nested objects and arrays partially.
You can provide {partial: false} for the schema or for one API to override for that API and do an update of the top level property (array) and not element by element.
Describe the bug
The onetable doesn't overwrite array of objects and instead try to set each field in the object during update operation. Example: in database I could have 2 photos in the array, so during update user can change the
name
andremove
one photo from array and I would expect the update operation to just overwrite the array but instead it tries to update fields in the object and it never remove item from array. Same issue happens when I pass empty array, none of photos are removed, as this is update operation I would expect to overwrite array and not try to update object each field in the array. Is this expecting behaviour?Right now I have to do something like this, but if I have multiple arrays I need to do it for each array.
Update operation log
Schema