Could you do this in the database with a .filter() ?