We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8900af commit ec0ab37Copy full SHA for ec0ab37
tests/lookup_/tests.py
@@ -137,28 +137,10 @@ def test_subquery_filter_constant(self):
137
"let": {},
138
"pipeline": [
139
{"$match": {"num": {"$gt": 2}}},
140
- {
141
- "$facet": {
142
- "group": [
143
- {"$group": {"_id": None, "tmp_name": {"$addToSet": "$num"}}}
144
- ]
145
- }
146
- },
147
148
- "$project": {
149
- "num": {
150
- "$ifNull": [
151
152
- "$getField": {
153
- "input": {"$arrayElemAt": ["$group", 0]},
154
- "field": "tmp_name",
155
156
157
- [],
158
159
160
161
+ {"$group": {"_id": None, "tmp_name": {"$addToSet": "$num"}}},
+ {"$unionWith": {"pipeline": [{"$documents": [{"tmp_name": []}]}]}},
+ {"$limit": 1},
+ {"$project": {"num": "$tmp_name"}},
162
],
163
}
164
},
0 commit comments