[SERVER-57892] Store empty arrays as empty arrays in MinMaxStore Created: 21/Jun/21  Updated: 27/Oct/23  Resolved: 20/Oct/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Kris Satya (Inactive) Assignee: Will Buerger
Resolution: Works as Designed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: Execution Team 2022-10-31
Participants:

 Description   

Currently, the MinMaxStore stores empty arrays as an array with a single element of type kUnset as opposed to an array with no elements in it. This results in the need for an additional check to handle this edge case. However, the MinMaxStore should really be storing empty arrays as an array with no elements, so we need to investigate where this is happening and make the appropriate change.



 Comments   
Comment by Will Buerger [ 20/Oct/22 ]

After investigation with dan.larkin-york@mongodb.com, we've concluded that the current implementation does not specifically store empty arrays as arrays with an unset element.

In the case where you have a type mismatch (e.g., object and array) between the min and the max in the MinMaxStore, it may include an unset element as a child of one of them so that the length of their sub-elements is the same. In some cases, this was perceived as storing an empty array as an array with an unset element.

Generated at Thu Feb 08 05:43:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.