Skip to content

Commit 763074d

Browse files
mungitoperritojeff-allen-mongo
authored andcommitted
DOCS-14215 add dateDiff and update week start
1 parent d2eee1c commit 763074d

File tree

5 files changed

+487
-0
lines changed

5 files changed

+487
-0
lines changed

source/includes/extracts-agg-operators.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,10 @@ content: |
379379
* - Name
380380
- Description
381381
382+
* - :expression:`$dateDiff`
383+
384+
- Returns the difference between two dates.
385+
382386
* - :expression:`$dateFromParts`
383387
384388
- Constructs a BSON Date object given the date's constituent
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
The timezone of the operation result. ``<tzExpression>`` must be a
2+
valid :ref:`expression <aggregation-expressions>` that resolves to a
3+
string formatted as either an `Olson Timezone Identifier
4+
<https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>`_ or a
5+
`UTC Offset <https://en.wikipedia.org/wiki/List_of_UTC_time_offsets>`_.
6+
If no ``timezone`` is provided, the result is displayed in ``UTC``.
7+
8+
.. list-table::
9+
:header-rows: 1
10+
:widths: 30 70
11+
12+
* - ``Format``
13+
- ``Examples``
14+
15+
* - `Olson Timezone Identifier`
16+
17+
- ::
18+
19+
"America/New_York"
20+
"Europe/London"
21+
"GMT"
22+
23+
* - `UTC Offset`
24+
25+
- ::
26+
27+
+/-[hh]:[mm], e.g. "+04:45"
28+
+/-[hh][mm], e.g. "-0530"
29+
+/-[hh], e.g. "+03"

source/reference/operator/aggregation.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@ Alphabetical Listing of Expression Operators
312312
- Returns the hyperbolic cosine of a value that is measured in
313313
radians.
314314

315+
* - :expression:`$dateDiff`
316+
317+
- Returns the difference between two dates.
318+
315319
* - :expression:`$dateFromParts`
316320

317321
- Constructs a BSON Date object given the date's constituent
@@ -1007,6 +1011,7 @@ Alphabetical Listing of Expression Operators
10071011
/reference/operator/aggregation/convert
10081012
/reference/operator/aggregation/cos
10091013
/reference/operator/aggregation/cosh
1014+
/reference/operator/aggregation/dateDiff
10101015
/reference/operator/aggregation/dateFromParts
10111016
/reference/operator/aggregation/dateToParts
10121017
/reference/operator/aggregation/dateFromString

0 commit comments

Comments
 (0)