Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-932

mongosh aggregate method ignores ADF-specific {background: true} option

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • 3

      Problem Statement/Rationale

      Switching from mongo to mongosh, I realized that the ADF-specific {background: true} aggregation is now ignored when using the aggregate method.

      Filing this as a bug since it's a regression in feature support compared to the OG MongoDB Shell.

      Steps to Reproduce

      How could an engineer replicate the issue you’re reporting?

      • Use mongosh to connect to Atlas Data Federation.
      • Use any database and collection to run the following:
        db.coll.aggregate([], {background: true})
      • Now run the same aggregation as a database command:
      db.runCommand({aggregate: "coll", pipeline: [], cursor: {batchSize: 0}, background: true})
      • Finally, run the first command using the old MongoDB Shell.

      Expected Results

      Behavior should be consistent. In this case, since {background: true} does not end w/ a $out stage, we should get the following error:

      MongoError: {background: true} option is only valid when $out is specified in the pipeline, correlationID = 16961275b12bf2b041ed9c54

      Actual Results

      No error when run using the aggregate method on mongosh. The option is not passed to ADF.

      Additional Notes

      EDIT: No need to support useCache for now.

      ADL will be adding a useCache aggregation option with an ongoing epic, MHOUSE-1267. This is primarily to support Charts and we will not be documenting this feature to users for the time being. However, it may be be good to allow this is well to support internal testing.

      db.coll.aggregate([], {useCache: {maxStalenessSeconds: 300, expireAfterSeconds: 86400, strict: false}})

       

            Assignee:
            gaurab.aryal@mongodb.com Gaurab Aryal
            Reporter:
            thomas.zembowicz@mongodb.com Thomas Zembowicz
            Votes:
            2 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated: