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

$dateFromParts should accept an object from another expression

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Aggregation Framework
    • Labels:
      None

      Description

      Currently $dateFromParts only accepts explicit objects with required fields. It should be able to accept an expression as long as expression evaluates to an object with the required fields.

      This way a date can round trip through $dateToParts and $dateFromParts and end up as the same value (which would have caught SERVER-30524, incidentally).

      date == {$dateFromParts:{$dateToParts:{date:"$date"}}}
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: