convert types in documents