Hierarchy

  • DateFromParts

Properties

Properties

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

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

Type declaration

  • 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 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 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 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 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 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 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 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 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.

  • 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.

Generated using TypeDoc