[SERVER-85892] $merge with pipeline after $documents returns error Created: 29/Jan/24  Updated: 05/Feb/24

Status: In Progress
Project: Core Server
Component/s: None
Affects Version/s: 7.2.0
Fix Version/s: None

Type: Bug Priority: Critical - P2
Reporter: Katya Kamenieva Assignee: Peter Volk
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
is caused by SERVER-65534 $documents doesn't work if a later st... Closed
Assigned Teams:
Query Optimization
Operating System: ALL
Steps To Reproduce:

db.aggregate([
 { "$documents": [{ a: 1 }] }, 
{ "$merge": { "into": "test", "whenMatched": [{$set: {new:true}}] }}
])

>>

{aggregate: 1}

is not valid for '$set'; a collection is required.

db.aggregate([
 { "$documents": [{ a: 1 }] }, 
{ "$merge": { "into": "test", "whenMatched": [] }}
])

>>

{aggregate: 1}

is not valid for an empty pipeline.

Sprint: QO 2024-02-05, QO 2024-02-19
Participants:

 Description   

Replicates on both RS and sharded clusters in 7.2.
Works as expected in 7.0.



 Comments   
Comment by Katya Kamenieva [ 29/Jan/24 ]

This issue was reported by user on dev forum

Generated at Thu Feb 08 06:58:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.