[COMPASS-5077] $unset template is incorrect Created: 08/Sep/21  Updated: 24/Feb/22  Resolved: 24/Feb/22

Status: Closed
Project: Compass
Component/s: Aggregation pipeline
Affects Version/s: None
Fix Version/s: 1.31.0

Type: Bug Priority: Minor - P4
Reporter: Brian Leonard Assignee: Massimiliano Marcon
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Story Points: 2
Documentation Changes: Not Needed

 Description   

When adding an $unset stage, you are provided with the following template:

/**
 * fields: The field name(s).
 */
{
  field
}

However, $unset expects an array of strings, not an object. So it should be:

/**
 * fields: The field name(s).
 */
[
  "field1", "field2"
]



 Comments   
Comment by Rhys Howell [ 24/Feb/22 ]

Fixed in COMPASS-4665

Comment by Massimiliano Marcon [ 09/Sep/21 ]

Making this a COMPASS ticket.

It's actually a string or array of strings, but yes, not an object.

Docs here for reference: https://docs.mongodb.com/manual/reference/operator/aggregation/unset/#syntax.

Generated at Wed Feb 07 22:38:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.