Operational Defect Database

BugZero found this defect 49 days ago.

MongoDB | 2627354

View resolution error on sharded view with $unionWith in explain

Last update date:

3/31/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.

Description:

Info

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

Top User Comments


Steps to Reproduce

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}}]}} ] ));

Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Needs Scheduling

Learn More

Search:

...