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

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

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL

       

      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:
            chris.kelly@mongodb.com Chris Kelly
            Reporter:
            danielcooke1996@gmail.com Daniel Cooke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: