-
Type: Task
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: CMAP
While monitoring a command, given collection name containing a '.' [the collectionName
helper method|https://github.com/mongodb/node-mongodb-native/blob/35255976074fdb6c986e4bc224a83464d0030f0d/src/cmap/command_monitoring_events.ts#L186] the method will return the collection name until the first period.
Ex: collectionName on a collection 'fs.chunk42' will return 'fs'
This is likely because of command monitoring failing to use the MongoDBNamespace class, and trying to separate database and collection names on its own.
The helper is used in extractCommand(command: WriteProtocolMessageType), and it will fail to parse the collectionName for legacy find commands (op_query) so it is unused.
Use Case
As a... user of the Node Driver
I want... organize our namespace handling
So that... we don't have repeated potentially buggy string-splitting/parsing behavior
Acceptance Criteria
Implementation Requirements
- Find all cases where a database and collection name are needed.
- Replace them with MongoDBNamespace instances.
- Update the ns helper to accept a db and collection name string as two arguments
- Remove (or cease use of) fromString helper that parses strings into namespaces
- Remove database name validation (preventing a dot in the name)
Testing Requirements
- Add a test that a database can be created with a dot in its name, and any subsequent operation will fail as a result.
Documentation Requirements
- None