-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
Developer Tools
After a conversation with Anna on Slack, we've found that .explain().aggregate() works different than .explain().find() and it should be fixed. However, this is inherited behaviour from the legacy mongo shell, so it would be a breaking change. The public documentation is also outdated, as the expected behaviour is what findd oes (which prints the explain plan) and not what aggregate does (which returns the explain plan): https://www.mongodb.com/docs/manual/reference/command/explain/#output
This affects the IntelliJ plugin, and likely any tool that generates explain plans dynamically, as this inconsistency makes the code generation more complicated.
The workaround is to default to use the options parameter that is available in all methods (usually the last parameter).