Assign type for Document.