On this page本页内容
$isoWeekYear
¶New in version 3.4.版本3.4中的新功能。
Returns the year number in ISO 8601 format. 以ISO 8601格式返回年份号。The year starts with the Monday of week 1 and ends with the Sunday of the last week.一年从第一周的星期一开始,到最后一周的星期日结束。
The $isoWeekYear
expression has the following operator expression syntax:$isoWeekYear
表达式具有以下运算符表达式语法:
Changed in version 3.6.在版本3.6中更改。
The argument must be a valid expression that resolves to one of the following:参数必须是解析为以下之一的有效表达式:
New in version 3.6.版本3.6中的新功能。
date |
<dateExpression> | ||||||
timezone |
|
Result | |
---|---|
2015 | |
2003 | |
2017 | |
2016 | |
2024 | |
error | |
error | |
error |
Note
$isoWeekYear
cannot take a string as an argument.无法将字符串作为参数。
A collection called 名为anniversaries
contains the following documents:anniversaries
的集合包含以下文档:
The following operation returns the year number in ISO 8601 format for each 以下操作以ISO 8601格式为每个date
field.date
字段返回年份号。
The operation returns the following results:操作返回以下结果: