-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: 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}})
- depends on
-
NODE-3448 Add support for {background: true} option for $out aggregation stage
- Closed
- is related to
-
NODE-3506 Aggregate collection helper does not support ADL options
- Closed
-
NODE-6140 Don't silently filter out { background: true } from aggregate
- Closed
- split to
-
MONGOSH-1766 Display warning when running aggregate with ignored background: true
- Closed