Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-5774

Remove wrapper operations and move them to Db and Collection classes

    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Use Case

      As a... node user
      I want... server selection to only be executed as many times as needed
      So that...  server selection timeoutMS is respected correctly.

      User Impact

      • Execute operation and server selection will not be performed multiple time
        • users will be able to witness this through shorter execution times and server selection logging events 

       

      Certain AbstractOperation subclasses are just wrappers to other commands and are not their own operations. They should not be subclasses of AbstractOperation, but rather be implemented in helper functions to Db and Collection classes. 

      An example of a wrapper class is IsCappedOperation, which only performs a listCollectionsOperation under the hood. This results in a duplicate executeOperation call. The class's functionality can just be moved collection.isCapped() function, and have the function execute listCollections.

       

      https://github.com/mongodb/node-mongodb-native/pull/4034 removed the redundant index management operations.

      AC

      • remove wrapper classes:
        • EnsureIndexOperation,
        • IndexInformationOperation,
        • CollectionsOperation,
        • IsCappedOperation,
        • OptionsOperation
        • IndexOperation
      • move their functionality to the corresponding functions that call them:
        • db.ensureIndex()
        • db.indexInformation()
        • db.collections()
        • collections.isCapped()
        • collection.options()
        • collections.indexOperation()
      • Audit this functionality to determine if any of them can be deprecated for the next major release

            Assignee:
            Unassigned Unassigned
            Reporter:
            aditi.khare@mongodb.com Aditi Khare
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: