@SlaaAvi I managed to insert an entry with relations similar to yours without passing any extra stuff.
tags: [1 ,3] supposed tags is a collection field and 1,3 are targetids
Note: The array must be of array form in the time of insertion. Watch out whether its stringified or something…
I created this function just for this purpose. It worked for me…
const filterModel = (model, item) => {
let res = {};
// console.log(model._attributes)
for(var i in model._attributes)
if(item[i]){
if(model._attributes[i].type) {
res[i] = item[i];
} else if (model._attributes[i].collection) {
res[i] = JSON.parse(item[i]);
} else if (model._attributes[i].model) {
res[i] = parseInt(item[i]);
}
}
return res;
}