I’m aware it’s built on Lucene and that’s the source of the underlying error. However, according to the documents this should work. The docs note numeric and date facets are NOT supported on embeddedDocuments, but does not mention incompatibility with stringFacet.
I need to know if stringFacet is also NOT supported and is accidentally omitted by the documentation, or if there is something wrong or missing in my syntax to get it working.
The error you are getting is because you are trying to create a stringFacet on a field that is an embedded document. MongoDB Atlas does not support faceting on embedded documents.
Gotcha, Then hopefully someone from the mongo team can hop in here and confirm it is indeed an inaccuracy with the documentation and it should state that no faceting of any kind is supported within embeddedDocuments.
Although this is an older question, I found it when searching for faceting information on EmbeddedDocuments.
Although you can’t create a StringFacet within a field indexed as an EmbeddedDocument, you can index the parent field as BOTH a document AND as an embeddedDocuments type.
So, for example, If I had an array field called “Tags” that contained documents with a property of “Name”, my index definition for this field would look like this: