-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Java Drivers
-
Needed
-
-
None
-
None
-
None
-
None
-
None
-
None
MonogDB Search's "facet" collector allows for a null/non-existent operator in order to facet across the entire collection. Unfortunately `SearchCollector.facet()` does not allow for a null operator:
https://github.com/mongodb/mongo-java-driver/blob/main/driver-core/src/main/com/mongodb/client/model/search/SearchCollector.java#L51
This causes one to resort to drop out of the driver conveniences and do something like this:
Arrays.asList(new Document("$searchMeta", new Document("index", "movies_index") .append("facet", new Document("facets", new Document("year", new Document("type", "string") .append("path", "year") .append("numBuckets", 100L))))))