objection.js
objection.js copied to clipboard
Can unrelate unrelated a given instance?
Confused about unrelate :( In the docs I can use relate to connect two instances like this:
const actor = await Person.query().findById(100);
const movie = await Movie.query().findById(200);
await actor.$relatedQuery('movies').relate(movie);
I had expected to be able to unrelate the same way:
const actor = await Person.query().findById(100);
const movie = await Movie.query().findById(200);
await actor.$relatedQuery('movies').unrelate(movie);
That doesn't seem to be possible. Am I missing something?