$fill throws an error implying duplicate values when there are none

XMLWordPrintableJSON

    • Query Integration
    • Fully Compatible
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      The situation described in the title can be reproduced as below:

       

      use test1
      db.restaurantReviewsMultiple.insertMany( [
      {
            date: ISODate("2021-03-08"),
            restaurant: "Joe's Pizza",
            score: 90
         },
         {
            date: ISODate("2021-03-08"),
            restaurant: "Sally's Deli",
            score: 75
         }
      ] )
      db.restaurantReviewsMultiple.aggregate( [
         {
            $fill:
               {
                  sortBy: { date: 1 },
                  partitionBy: { "restaurant": "$restaurant" },
                  output:
                     {
                        "score": { method: "linear" }
                     }
               }
         }
      ] )
      MongoServerError: PlanExecutor error during aggregation :: caused by :: There can be no repeated values in the sort field
      

       

      In the example above, the error message obtained can be confusing as each partitionBy - restaurant has only 1 entry and with the same date, there are no values for $fill to interpolate between. 

       

      The question is:
      1. Could this be changed to a no-op?
      2. If not, can this error message be updated?

      Thanks,
      Baptiste

            Assignee:
            Ted Tuckman
            Reporter:
            Baptiste Blanchard
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: