I am not too sure but it looks like you have too many indexes with hostname as prefix.
The index {hostname:1} is certainly redundant and useless because you also have {hostname:1,name:1}. Retry after removing this index.
Is the last index (hostname,name,type) really used for some use-case? It should not be a problem but that’s at the edge of my knowledge.
You do not specify any options so it puzzles me that you get InvalidOptions. Try passing 2 empty objects (with ,{},{}) so see what is going on.