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

Support database-level aggregations for mongod in compute-mode

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • QI 2023-05-01, QI 2023-05-15, QI 2023-05-29

      If mongod is started with –setParameter enableComputeMode=true, it only supports collection-level aggregations that reference at least one external data source. It would be nice to support database-level aggregations (i.e. {aggregate: 1} commands) in this mode as well so that stages like $documents can be executed successfully.

      Update by Yoonsoo:
      Example repro:
      In one window

      $ build/install/bin/mongod --setParameter enableComputeMode=true
      

      In test shell of another window

      > db.aggregate([{$documents: [{a: 1}]}]);
      

      Error message is thrown by this code
      https://github.com/10gen/mongo/blob/master/src/mongo/db/commands/pipeline_command.cpp/#L128

      We can do early return before the above check if the aggregate command is a collectionless one.

            Assignee:
            yoonsoo.kim@mongodb.com Yoon Soo Kim
            Reporter:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: