Is there a way to append object in an array of object of type JSON field?

I want to append products(object) in the wishlist(Array) which is stored as JSON field in my JWT collection type. On updating with default update route strapi simply replaces the whole data with the new one. Is there a way to achieve this?

Every time you update a field it replaces the current value, that’s how updates works

If you want to achieve this functionality you have to take one or two extra steps

  1. Fetch all the data of row that you want to update.
  2. Take out wishlist property
  3. Push / Merge your body data to fetched wishlist data
  4. Update the entry with new merged data

You have to write a custom controller or extend the default update controller to achieve this functionality

thanks i did that. it is working now

Hi, how to update on this way on the user model?

i’d need the same guys, any updates how to do that??