collectionName helper and entityToDocument

all the fields make a document, so
entityToDocument is a better name than entityToFields