Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • DateFromParts

Index

Properties

Properties

$dateFromParts: { isoWeekYear?: NumberExpression; isoWeek?: NumberExpression; isoDayOfWeek?: NumberExpression; year?: NumberExpression; month?: NumberExpression; day?: NumberExpression; hour?: NumberExpression; minute?: NumberExpression; second?: NumberExpression; millisecond?: NumberExpression; timezone?: tzExpression }

Constructs a BSON Date object given the date's constituent parts.

version

3.6

see

https://docs.mongodb.com/manual/reference/operator/aggregation/dateFromParts/#mongodb-expression-exp.-dateFromParts

Type declaration

  • Optional isoWeekYear?: NumberExpression

    ISO Week Date Year. Can be any expression that evaluates to a number.

    Value range: 1-9999

    If the number specified is outside this range, $dateFromParts errors. Starting in MongoDB 4.4, the lower bound for this value is 1. In previous versions of MongoDB, the lower bound was 0.

  • Optional isoWeek?: NumberExpression

    Week of year. Can be any expression that evaluates to a number.

    Defaults to 1.

    Value range: 1-53

    Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples.

  • Optional isoDayOfWeek?: NumberExpression

    Day of week (Monday 1 - Sunday 7). Can be any expression that evaluates to a number.

    Defaults to 1.

    Value range: 1-7

    Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples.

  • Optional year?: NumberExpression

    Calendar year. Can be any expression that evaluates to a number.

    Value range: 1-9999

    If the number specified is outside this range, $dateFromParts errors. Starting in MongoDB 4.4, the lower bound for this value is 1. In previous versions of MongoDB, the lower bound was 0.

  • Optional month?: NumberExpression

    Month. Can be any expression that evaluates to a number.

    Defaults to 1.

    Value range: 1-12

    Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples.

  • Optional day?: NumberExpression

    Day of month. Can be any expression that evaluates to a number.

    Defaults to 1.

    Value range: 1-31

    Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples.

  • Optional hour?: NumberExpression

    Hour. Can be any expression that evaluates to a number.

    Defaults to 0.

    Value range: 0-23

    Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples.

  • Optional minute?: NumberExpression

    Minute. Can be any expression that evaluates to a number.

    Defaults to 0.

    Value range: 0-59 Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples.

  • Optional second?: NumberExpression

    Second. Can be any expression that evaluates to a number.

    Defaults to 0.

    Value range: 0-59

    Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples.

  • Optional millisecond?: NumberExpression

    Millisecond. Can be any expression that evaluates to a number.

    Defaults to 0.

    Value range: 0-999

    Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples.

  • Optional timezone?: tzExpression

    The timezone to carry out the operation. 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.

Generated using TypeDoc