On this page本页内容
$isoDayOfWeek
¶New in version 3.4.版本3.4中的新功能。
Returns the weekday number in ISO 8601 format, ranging from 以ISO 8601格式返回工作日编号,范围从1
(for Monday) to 7
(for Sunday).1
(周一)到7
(周日)。
The $isoDayOfWeek
expression has the following operator expression syntax:$isoDayOfWeek
表达式具有以下运算符表达式语法:
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> must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID.<dateExpression> 必须是解析为日期、时间戳或ObjectID的有效表达式。 | ||||||
timezone |
|
Result | |
---|---|
5 | |
2 | |
7 | |
6 | |
5 | |
error | |
error | |
error |
Note
$isoDayOfWeek
cannot take a string as an argument.不能将字符串作为参数。
A collection called 名为birthdays
contains the following documents:birthdays
的集合包含以下文档:
The following operation returns the weekday number for each 以下操作返回每个birthday
field.birthday
字段的工作日编号。
The operation returns the following results:操作返回以下结果:
See also参阅