BugZero found this defect 49 days ago.
Data sources
All data on this page is proprietary to BugZero® or gathered from public sources
3/31/2024
MongoDB Server
No affected releases provided.
No fixed releases provided.
View resolution for views used in $unionWith pipelines is not resolved correctly in explain, however, it seems to be working just fine when running a regular aggregate
Run the following test case in sharded_collections_jscore_passthrough suite const coll = assertDropAndRecreateCollection(db, jsTestName()); const viewName = "identityView"; assertDropCollection(db, viewName); assert.commandWorked(db.createView(viewName, coll.getName(), [])); const secondaryColl = assertDropAndRecreateCollection(db, "secondary"); const secondaryViewName = "secondaryIdentityView"; assertDropCollection(db, secondaryViewName); assert.commandWorked(db.createView(secondaryViewName, secondaryColl.getName(), [])); // Works just fine. jsTestLog(coll.aggregate([ {$match: {a: 1, b: 5}}, {$unionWith: {coll: secondaryViewName, pipeline: [{$match: {a: 1, b: 5}}]}} ] ).toArray()); // Fails to resolve the view. jsTestLog(coll.explain().aggregate([ {$match: {a: 1, b: 5}}, {$unionWith: {coll: secondaryViewName, pipeline: [{$match: {a: 1, b: 5}}]}} ] ));