-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Operations Layer
Use Case
As a... Node Engineer
I want... to be able to access the name of a command at any point after the operation instance is constructed
So that... server selection logging (NODE-4687) can be unblocked.
User Impact
- This will be an internal variable, no users will be directly affected.
Dependencies
- No breaking changes
Acceptance Criteria
Implementation Requirements
- Add abstract get commandName() to AbstractOperation and all direct subclasses of AbstractOperation
- ex: FindOperation, InsertOperation, CreateIndexesOperation...
- commandName will match the command key originally only available during/after command execution
- commandName trickles down subclasses unless overridden
- commandName accessible through operation.commandName and subclassName.prototype's getter call (do not use "this" keyword in getter)
Testing Requirements
- Testing: add unit tests for all subclasses of abstractOperation:
- Ensure each subclass has correct commandName string, accessible by getter
- Ensure commandName first key of command's name === commandName
- commandName = 'createIndexes'
- const cmd: Document { createIndexes: this.collectionName, indexes}
- potentially use sinon to spy on server.command
- Ensure commandName accessible through operation.commandName
Documentation Requirements
- None
Follow Up Requirements
- Unblock
NODE-4687
- has to be done before
-
NODE-4687 Add log messages to Server selection spec
- Closed