[JAVA-4673] Permit empty objects as expressions in $set and $addFields aggregation stages Created: 11/Jul/22  Updated: 27/Oct/23  Resolved: 26/Aug/22

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: PM Bot Assignee: Unassigned
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
Server Compat: 6.1
Upstream Changes Summary:

DRIVERS-2374:
$addFields and $set will no longer throw an error if you want to set a path to an empty object.
For example the stage {$set: {a: {}}} would take an incoming document and set the 'a' field to an empty object.
The behavior of $project behavior has not been changed and in order to get the same behavior a user would still have to wrap the object with $literal like this: {$project: {a: {$literal: {}}}}


 Description   

This ticket was split from DRIVERS-2374, please see that ticket for a detailed description.



 Comments   
Comment by Jeffrey Yemin [ 26/Aug/22 ]

There's nothing for the Java driver to do here, even after adding expression builders.

Generated at Thu Feb 08 09:02:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.