Here is an example.
Database content:
[{
id: 1,
name: 'Foo',
// This is a ManyToManyRelation
movies: [{
id: 1,
title: 'Horrible Bosses',
}, {
id: 2,
title: 'Wanderlust'
}]
}]
Query:
.query()
.upsertGraph({
id: 1,
// update name:
name: 'Bar',
movies: [{
// Add a relation
id: 3,
}, {
// And insert another one.
title: 'Loved it'
}]
}]
});
I would like to obtain the following database state where previously related movies are still related even though not present in the graph data.
[{
id: 1,
name: 'Bar',
movies: [{
id: 1,
title: 'Horrible Bosses',
}, {
id: 2,
title: 'Wanderlust',
}, {
id: 3,
title: 'Wanderlust 2',
}, {
id: 10,
title: 'Loved it'
}]
}]
Is there a way to achieve this currently? If it is not the case, could you please add such a feature?
Thank you.
An option(s) for disabling any of delete/unrelate, insert/relate and update could be useful. I have to give this some thought so that we don't end up with an incoherent mess of options.
@manubb @lehni The new flags are now available in the master branch. Please test them out if you have time.
Most helpful comment
@manubb @lehni The new flags are now available in the master branch. Please test them out if you have time.