Details
-
Improvement
-
Resolution: Won't Do
-
Minor - P4
-
None
-
None
Description
Looking at a CRUD FLE test such as https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/basic.yml#L24, it appears that $db assertions in command monitoring events are only specified for some of the events. Specifically, key vault client operations appear to have $db specified, and top-level client operations appear to not have it specified.
Since these tests specify the database names that are to be used for the entire test (https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/basic.yml#L3), it seems that the tests should be capable of specifying $db for each command monitoring event.
If so it seems that having $db be specified for all command monitoring events will achieve the following benefits:
1. It will make the spec test runner more uniform since it be able to always assert $db rather than containing logic to assert $db conditionally;
2. It will catch instances of the driver publishing command monitoring events with the wrong indicated database name.