@@ -144,7 +144,7 @@ private module PyMongo {
144144 private class MongoMapReduceQuery extends API:: CallNode , NoSqlExecution:: Range {
145145 MongoMapReduceQuery ( ) { this = mongoCollection ( ) .getMember ( "map_reduce" ) .getACall ( ) }
146146
147- override DataFlow:: Node getQuery ( ) { result in [ this .getArgByName ( "query" ) ] }
147+ override DataFlow:: Node getQuery ( ) { result = this .getArgByName ( "query" ) }
148148
149149 override predicate interpretsDict ( ) { any ( ) }
150150
@@ -178,19 +178,20 @@ private module PyMongo {
178178 * See https://www.mongodb.com/docs/manual/reference/operator/aggregation/function/#mongodb-expression-exp.-function
179179 */
180180 private class FunctionQueryOperator extends DataFlow:: Node , Decoding:: Range {
181- API:: Node dictionary ;
182181 DataFlow:: Node query ;
183182
184183 FunctionQueryOperator ( ) {
185- dictionary =
186- mongoCollection ( )
187- .getMember ( mongoCollectionMethodName ( ) )
188- .getACall ( )
189- .getParameter ( 0 )
190- .getASubscript * ( )
191- .getSubscript ( "$function" ) and
192- query = dictionary .getSubscript ( "body" ) .asSink ( ) and
193- this = dictionary .asSink ( )
184+ exists ( API:: Node dictionary |
185+ dictionary =
186+ mongoCollection ( )
187+ .getMember ( mongoCollectionMethodName ( ) )
188+ .getACall ( )
189+ .getParameter ( 0 )
190+ .getASubscript * ( )
191+ .getSubscript ( "$function" ) and
192+ query = dictionary .getSubscript ( "body" ) .asSink ( ) and
193+ this = dictionary .asSink ( )
194+ )
194195 }
195196
196197 override DataFlow:: Node getAnInput ( ) { result = query }
@@ -208,19 +209,20 @@ private module PyMongo {
208209 * See https://www.mongodb.com/docs/manual/reference/operator/aggregation/accumulator/#mongodb-group-grp.-accumulator
209210 */
210211 private class AccumulatorQueryOperator extends DataFlow:: Node , Decoding:: Range {
211- API:: Node dictionary ;
212212 DataFlow:: Node query ;
213213
214214 AccumulatorQueryOperator ( ) {
215- dictionary =
216- mongoCollection ( )
217- .getMember ( "aggregate" )
218- .getACall ( )
219- .getParameter ( 0 )
220- .getASubscript * ( )
221- .getSubscript ( "$accumulator" ) and
222- query = dictionary .getSubscript ( [ "init" , "accumulate" , "merge" , "finalize" ] ) .asSink ( ) and
223- this = dictionary .asSink ( )
215+ exists ( API:: Node dictionary |
216+ dictionary =
217+ mongoCollection ( )
218+ .getMember ( "aggregate" )
219+ .getACall ( )
220+ .getParameter ( 0 )
221+ .getASubscript * ( )
222+ .getSubscript ( "$accumulator" ) and
223+ query = dictionary .getSubscript ( [ "init" , "accumulate" , "merge" , "finalize" ] ) .asSink ( ) and
224+ this = dictionary .asSink ( )
225+ )
224226 }
225227
226228 override DataFlow:: Node getAnInput ( ) { result = query }
0 commit comments