DateToParts constructor

DateToParts(
  1. dynamic date, {
  2. dynamic timezone,
  3. bool iso8601 = false,
})

Creates $dateToParts operator expression

Returns a document that contains the constituent parts of a given BSON Date value as individual properties. The properties returned are year, month, day, hour, minute, second and millisecond. You can set the iso8601 property to true to return the parts representing an ISO week date instead. This will return a document where the properties are isoWeekYear, isoWeek, isoDayOfWeek, hour, minute, second and millisecond.

Implementation

DateToParts(date, {timezone, bool iso8601 = false})
    : super('dateToParts',
          AEObject({'date': date, 'timezone': timezone, 'iso8601': iso8601}));