-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: 8.0.13, 9.0.4
-
Component/s: None
-
Query Execution
-
ALL
-
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Description
When usingĀ $densify with bounds: "full" and partitionByFields, MongoDB generates duplicate documents for dates that already exist in the input.
The issue occurs when the first document of a partition is exactly one step after the global minimum date.
Replacing bounds: "full" with explicit date bounds covering the same period resolves the issue.
Expected Behavior
The global date range spans January through March 2011.
Each of the three partitions should contain exactly one document per month, resulting in 9 documents.
Existing documents should be preserved, and only missing dates should be generated.
Actual Behavior
With bounds: "full", MongoDB produces duplicate partition/date combinations.
In particular, the Acme/Sales partition already contains a document for February 1, 2011, but $densify also generates a document for that same date.
With explicit bounds [2011-01-01T00:00:00Z, 2011-04-01T00:00:00Z], the aggregation returns the expected 9 documents without duplicates.