jstests/noPassthrough/merge_causes_infinite_loop.js
// Returns a pipeline which outputs to the specified collection.
Returns a pipeline which outputs to the specified collection.
Returns a pipeline which outputs to the specified collection .
function pipeline(outColl) {
    return [
        {$match: {a: {$gt: 0}}},
        {$merge: {into: outColl, whenMatched: [{$addFields: {a: {$multiply: ["$a", 2]}}}]}}
    ];
}
function pipeline ( outColl ) { return [ { $match : { a : { $gt : 0 } } } , { $merge : { into : outColl , whenMatched : [ { $addFields : { a : { $multiply : [ "$a" , 2 ] } } } ] } } ] ; }
Returns a pipeline which outputs to the specified collection.
Returns a pipeline which outputs to the specified collection .