-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
Based on the check here, the read preference should not be set for an aggregation that contains a $out (or $merge). However, when the pipeline is checked for a $out stage here, it does LookupErr("$out") on an array document that looks like this:
{"0": {"$out": {"db": "test_db","coll": "test_dcoll"}}}
So no top-level $out is found, and the readPref is being set, resulting in a potential error on $out.