Support Topics Documentation Slack YouTube Blog

Reset a relation field to empty

(Stanislaw Grin) #21

The server should know which objects it should remove, so without knowing of child ids its impossible.
I think you should change your client logic. How about storing unselected ingredients in some array and if user hits “Save” you can easily find out which ingredients he kept and which are gone.

(Marcio Prudencio) #22

To future reference, I accomplish the desired action using setRelation passing an empty object.

Backendless.Data.of(“Products”).setRelation(productId, “ingredients:Ingredients:n”, [])