...
$unionWIth $search explain errors out when using $search and $$SEARCH_META in the subpipeline since SEARCH_META is used in the original run of the pipeline which seems to add it in the let variables. Then when $unionWith reruns the pipeline for explain, it errors due to SEARCH_META not being allowed to be in the letVariables. pipeline: [{ $unionWith: { coll: searchColl.getName(), pipeline: [ {$search: mongotQuery}, { $project: { "_id": 0, "ref_id": "$_id", "title": "$title", "searchMeta": "$$SEARCH_META", } } ] } }] A possible solution is to clear SEARCH_META from the let variables.
xgen-internal-githook commented on Tue, 13 Aug 2024 16:03:22 +0000: Author: {'name': 'erinzhu001', 'email': 'erin.zhu@mongodb.com', 'username': 'erinzhu001'} Message: SERVER-92337 Reset variables for $unionWith during second execution of subpipeine for explain (#26029) GitOrigin-RevId: 3706ed48ec7ff9eb606181d300d65757350606d4 Branch: master https://github.com/mongodb/mongo/commit/28261ea89f9321cee72e8462101067aea5657841
Click on a version to see all relevant bugs
MongoDB Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.