Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-4673

Permit empty objects as expressions in $set and $addFields aggregation stages

    • Type: Icon: Improvement Improvement
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Hide

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

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

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

            Assignee:
            Unassigned Unassigned
            Reporter:
            dbeng-pm-bot PM Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: