Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-68108

$densify with dynamic bounds array causes "A bounding array must contain either both dates or both numeric types" error

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 6.0.0-rc13
    • Component/s: None
    • None
    • ALL
    • QO 2022-08-08

       

      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?

            Assignee:
            samuel.mercier@mongodb.com Sam Mercier
            Reporter:
            danielcooke1996@gmail.com Daniel Cooke
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: