Script:
(function () { 'use strict'; const collName = "fuzzer_coll"; const aggregationList = [ {"$lookup":{ "from": collName, "localField": "foo", "foreignField": "bar", "as": "array" }}]; const documentList = [{ "_id" : 49, "foo": [1, [1]], "bar": 1, }]; const coll = db[collName]; coll.drop(); assert.commandWorked(coll.insert(documentList)); const indexList = [\{bar: 1}]; assert.commandWorked(coll.createIndexes(indexList)); assert.commandWorked(db.adminCommand({setParameter: 1, internalQuerySlotBasedExecutionDisableLookupPushdown: false})); const sberes = coll.aggregate(aggregationList).toArray(); jsTestLog("123123 sbe result " + tojson(sberes)); assert.commandWorked(db.adminCommand({setParameter: 1, internalQuerySlotBasedExecutionDisableLookupPushdown: true})); const classicres = coll.aggregate(aggregationList).toArray(); jsTestLog("123123 classic result " + tojson(classicres)); assert.commandWorked(db.adminCommand({setParameter: 1, internalQuerySlotBasedExecutionDisableLookupPushdown: false})); assert.eq(sberes, classicres); })();
Output:
[[ { "_id" : 49, "foo" : [ 1, [ 1 ] ], "bar" : 1, "array" : [ { "_id" : 49, "foo" : [ 1, [ 1 ] ], "bar" : 1 }, { "_id" : 49, "foo" : [ 1, [ 1 ] ], "bar" : 1 } ] } ]] != [[ { "_id" : 49, "foo" : [ 1, [ 1 ] ], "bar" : 1, "array" : [ { "_id" : 49, "foo" : [ 1, [ 1 ] ], "bar" : 1 } ] } ]]