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: {}}}}
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.