Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-82109

Refactor ExpressionContext to use designated initializers

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • Fully Compatible
    • QE 2024-10-28

      Currently ExpressionContext has multiple constructors that has multiple default values in their arguments.

      Multiple commands like find and distinct create the ExpressionContext from the existing constructors and pass multiple attributes that should have been default values

      Proposal is to use designated initilizer when constructing ExpressionContext and if constructors are necessary, then we could create a aggregate config struct and use it as the constructor parameter.

      The example usage would be like this:

       

      auto pool = ThreadPool({.min_threads = 1, .max_threads=10, .idle_time = Seconds(10)}) 

       

            Assignee:
            nicola.cabiddu@mongodb.com Nicola Cabiddu
            Reporter:
            denis.grebennicov@mongodb.com Denis Grebennicov
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: