Cast object ids to string in has-many relations to make things work correctly with MongoDB