Filter falsy values (non-docs/refs) from sets in `update_hasmany`