Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • DateTrunc

Index

Properties

Properties

$dateTrunc: { date: DateExpression; unit: StringExpression<DateUnit>; binSize?: NumberExpression; timezone?: tzExpression; startOfWeek?: StringExpression<StartOfWeek> }

Type declaration

  • date: DateExpression

    The date to truncate, specified in UTC. The date can be any expression that resolves to a Date, a Timestamp, or an ObjectID.

  • unit: StringExpression<DateUnit>

    The unit of time, specified as an expression that must resolve to one of these strings:

    • year
    • quarter
    • week
    • month
    • day
    • hour
    • minute
    • second
    • millisecond

    Together, binSize and unit specify the time period used in the $dateTrunc calculation.

  • Optional binSize?: NumberExpression

    The numeric time value, specified as an expression that must resolve to a positive non-zero number. Defaults to 1.

    Together, binSize and unit specify the time period used in the $dateTrunc calculation.

  • Optional timezone?: tzExpression

    The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.

  • Optional startOfWeek?: StringExpression<StartOfWeek>

    Used when the unit is equal to week. Defaults to Sunday. The startOfWeek parameter is an expression that resolves to a case insensitive string:

    • monday (or mon)
    • tuesday (or tue)
    • wednesday (or wed)
    • thursday (or thu)
    • friday (or fri)
    • saturday (or sat)
    • sunday (or sun)

Generated using TypeDoc