To remove created associations you can just call the set method without a specific id:

    1. // remove the association with task1
    2. project.setTasks([task2]).then(associatedTasks => {
    3. // you will get task2 only
    4. })
    5. // remove 'em all
    6. project.setTasks([]).then(associatedTasks => {
    7. // you will get an empty array
    8. })
    9. project.removeTask(task1).then(() => {
    10. // it's gone
    11. })
    12. // and add 'em again
    13. project.addTask(task1).then(() => {
    14. // it's back again
    15. })

    For hasOne/belongsTo it's basically the same:

    When getting data on an association that has a custom join table, the data from the join table will be returned as a DAO instance:

    1. u.getProjects().then(projects => {
    2. const project = projects[0]
    3. if (project.UserProjects.status === 'active') {
    4. // .. do magic
    5. // since this is a real DAO instance, you can save it directly after you are done doing magic
    6. return project.UserProjects.save()
    7. })