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

Investigate Preferred $densify Behavior

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Investigate how we should treat months in $densify.

      Currently the way $densify works is by keeping track of the lastSeen value, and with every doGetNext() adding the desired step to it and then updating it. When working with months, this causes the following behavior:

      If we densify over a range, starting with January 31st with a step of 1 month, the next document would be February 28th since there are only 28 days in February and timelib takes care of this truncation. Then the next document returned is March 28, since this is one month from February 28th and we don't keep track of the original date.

      The question becomes if the desired behavior is to actually get Jan 31, Feb 28, and then back to March 31st? If so, we would need to change the implementation of densify to always add the step times a delta to the original lower bound of the range.

      Would making this change be breaking the rules of stable API?

      There are other questions as well, such as how to treat the 30th of the month. If we start with April 30, should the next month be May 30 or May 31? Since April 30 is the last day of month. There are many edgecases to consider.

            Assignee:
            kateryna.kamenieva@mongodb.com Katya Kamenieva
            Reporter:
            naama.bareket@mongodb.com Naama Bareket
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None