[SERVER-68107] $densify with dynamic bounds array causes "A bounding array must contain either both dates or both numeric types" error Created: 18/Jul/22  Updated: 19/Jul/22  Resolved: 19/Jul/22

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

Type: Bug Priority: Major - P3
Reporter: Daniel Cooke Assignee: Chris Kelly
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-68108 $densify with dynamic bounds array ca... Closed
Operating System: ALL
Participants:

 Description   

 

I am trying to add missing data to my time series with the `$densify` operator. 

But it does not seem to work when I specify any dynamic values in the bounds array.

*Example*
With a simple data set:
```js
[
   { week: 1, value: 20 },
   { week: 2, value: 30 },
]
```
I want to fill in all weeks *up until todays date

So with the following `$densify` operator I would expect it to work properly:
```js
{
  field: "week",
  range:

{     step: 1,     bounds: [       0,       \{ $week: "$$CLUSTER_TIME" }

    ]
  }
}
```

But I get the following error:

`A bounding array must contain either both dates or both numeric types`

Which does not make sense, because `{ $week: "$$CLUSTER_TIME" }` evalutes to a number, and 0 is definetly a number last I checked.

Sounds like a bug with mongo to me, anyone know?



 Comments   
Comment by Chris Kelly [ 19/Jul/22 ]

Closing this one as it duplicates SERVER-68108

Generated at Thu Feb 08 06:09:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.