Cast ORM entity ids to string when querying versions stored in mongo