When running this code:
let collation = {collation: {locale: "fr", backwards: true}}; db.collection.explain().aggregate([], collation);
The collation document is modified to also have an explain: true field. This is really annoying, because it means I can't use the same options document in multiple commands if an explain is interspersed between them.
Seems like the bug is in the explain part of the shell code, as db._runAggregate() explicitly makes a copy of the options doc to avoid changing the input parameter.
- links to