Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Commit a02228c

Browse files
committed
Add comment for all examples converted to verbose form
1 parent 248551d commit a02228c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+57
-26
lines changed

generator/config/accumulator/covariancePop.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ tests:
3030
covariancePopForState:
3131
$covariancePop:
3232
-
33+
# Example uses the short form, the builder always generates the verbose form
3334
# $year: '$orderDate'
3435
$year:
3536
date: '$orderDate'

generator/config/accumulator/covarianceSamp.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ tests:
3030
covarianceSampForState:
3131
$covarianceSamp:
3232
-
33+
# Example uses the short form, the builder always generates the verbose form
3334
# $year: '$orderDate'
3435
$year:
3536
date: '$orderDate'

generator/config/accumulator/push.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ tests:
2626
$group:
2727
_id:
2828
day:
29+
# Example uses the short form, the builder always generates the verbose form
2930
# $dayOfYear: '$date'
3031
$dayOfYear:
3132
date: '$date'
3233
year:
34+
# Example uses the short form, the builder always generates the verbose form
3335
# $year: '$date'
3436
$year:
3537
date: '$date'

generator/config/accumulator/sum.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ tests:
2222
$group:
2323
_id:
2424
day:
25+
# Example uses the short form, the builder always generates the verbose form
2526
# $dayOfYear: '$date'
2627
$dayOfYear:
2728
date: '$date'
2829
year:
30+
# Example uses the short form, the builder always generates the verbose form
2931
# $year: '$date'
3032
$year:
3133
date: '$date'

generator/config/expression/arrayToObject.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ tests:
2020
$project:
2121
item: 1
2222
dimensions:
23-
# The example renders a single value, but the builder generates an array for consistency
23+
# Example uses the short form, the builder always generates the verbose form
2424
# $arrayToObject: '$dimensions'
2525
$arrayToObject:
2626
- '$dimensions'

generator/config/expression/avg.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ tests:
2121
-
2222
$project:
2323
quizAvg:
24+
# Example uses the short form, the builder always generates the verbose form
2425
# $avg: '$quizzes'
2526
$avg:
2627
- '$quizzes'

generator/config/expression/dateAdd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ tests:
4646
unit: 'day'
4747
amount: 3
4848
-
49+
# Example uses the short form, the builder always generates the verbose form
4950
# $merge: 'shipping'
5051
$merge:
5152
into: 'shipping'

generator/config/expression/dateFromString.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,5 @@ tests:
7676
$dateFromString:
7777
dateString: '$date'
7878
timezone: '$timezone'
79-
# onNull: new Date(0)
8079
onNull: !bson_utcdatetime 0
8180

generator/config/expression/dateSubtract.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ tests:
4343
$expr:
4444
$eq:
4545
-
46+
# Example uses the short form, the builder always generates the verbose form
4647
# $month: '$logout'
4748
$month:
4849
date: '$logout'
@@ -55,6 +56,7 @@ tests:
5556
unit: 'hour'
5657
amount: 3
5758
-
59+
# Example uses the short form, the builder always generates the verbose form
5860
# $merge: 'connectionTime'
5961
$merge:
6062
into: 'connectionTime'

generator/config/expression/dayOfMonth.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ tests:
3030
-
3131
$project:
3232
day:
33+
# Example uses the short form, the builder always generates the verbose form
3334
# $dayOfMonth: '$date'
3435
$dayOfMonth:
3536
date: '$date'

generator/config/expression/dayOfWeek.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ tests:
3030
-
3131
$project:
3232
dayOfWeek:
33+
# Example uses the short form, the builder always generates the verbose form
3334
# $dayOfWeek: '$date'
3435
$dayOfWeek:
3536
date: '$date'

generator/config/expression/dayOfYear.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ tests:
3030
-
3131
$project:
3232
dayOfYear:
33+
# Example uses the short form, the builder always generates the verbose form
3334
# $dayOfYear: '$date'
3435
$dayOfYear:
3536
date: '$date'

generator/config/expression/getField.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ tests:
3333
$expr:
3434
$gt:
3535
-
36-
# the builder uses the verbose form with parameter names
36+
# Example uses the short form, the builder always generates the verbose form
3737
# $getField: 'price.usd'
3838
$getField:
3939
field: 'price.usd'
@@ -48,7 +48,7 @@ tests:
4848
$gt:
4949
-
5050
$getField:
51-
# the builder uses the verbose form with parameter names
51+
# Example uses the short form, the builder always generates the verbose form
5252
# $literal: '$price'
5353
field:
5454
$literal: '$price'

generator/config/expression/hour.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ tests:
3030
-
3131
$project:
3232
hour:
33+
# Example uses the short form, the builder always generates the verbose form
3334
# $hour: '$date'
3435
$hour:
3536
date: '$date'

generator/config/expression/isArray.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ tests:
2222
$cond:
2323
if:
2424
$and:
25-
# The example in the docs uses the short syntax for $isArray,
26-
# but the aggregation builder always uses the more verbose syntax.
25+
# Example uses the short form, the builder always generates the verbose form
2726
-
2827
$isArray:
2928
- '$instock'

generator/config/expression/isoDayOfWeek.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ tests:
3232
_id: 0
3333
name: '$name'
3434
dayOfWeek:
35+
# Example uses the short form, the builder always generates the verbose form
3536
# $isoDayOfWeek: '$birthday'
3637
$isoDayOfWeek:
3738
date: '$birthday'

generator/config/expression/isoWeek.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ tests:
3232
_id: 0
3333
city: '$city'
3434
weekNumber:
35+
# Example uses the short form, the builder always generates the verbose form
3536
# $isoWeek: '$date'
3637
$isoWeek:
3738
date: '$date'

generator/config/expression/isoWeekYear.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ tests:
3030
-
3131
$project:
3232
yearNumber:
33+
# Example uses the short form, the builder always generates the verbose form
3334
# $isoWeekYear: '$date'
3435
$isoWeekYear:
3536
date: '$date'

generator/config/expression/map.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ tests:
5353
input: '$distances'
5454
as: 'decimalValue'
5555
in:
56-
# The example renders a single value, but the builder generates an array for consistency
56+
# Example uses the short form, the builder always generates the verbose form
5757
# $trunc: '$$decimalValue'
5858
$trunc:
5959
- '$$decimalValue'

generator/config/expression/max.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ tests:
2121
-
2222
$project:
2323
quizMax:
24+
# Example uses the short form, the builder always generates the verbose form
2425
# $max: '$quizzes'
2526
$max:
2627
- '$quizzes'

generator/config/expression/millisecond.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ tests:
3030
-
3131
$project:
3232
milliseconds:
33+
# Example uses the short form, the builder always generates the verbose form
3334
# $millisecond: '$date'
3435
$millisecond:
3536
date: '$date'

generator/config/expression/min.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ tests:
2121
-
2222
$project:
2323
quizMin:
24+
# Example uses the short form, the builder always generates the verbose form
2425
# $min: '$quizzes'
2526
$min:
2627
- '$quizzes'

generator/config/expression/minute.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ tests:
3030
-
3131
$project:
3232
minutes:
33+
# Example uses the short form, the builder always generates the verbose form
3334
# $minute: '$date'
3435
$minute:
3536
date: '$date'

generator/config/expression/month.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ tests:
3030
-
3131
$project:
3232
month:
33+
# Example uses the short form, the builder always generates the verbose form
3334
# $month: '$date'
3435
$month:
3536
date: '$date'

generator/config/expression/objectToArray.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ tests:
3333
warehouses:
3434
$objectToArray: '$instock'
3535
-
36-
# The builder uses the verbose form of the $unwind operator
36+
# Example uses the short form, the builder always generates the verbose form
3737
# $unwind: '$warehouses'
3838
$unwind:
3939
path: '$warehouses'

generator/config/expression/pow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ tests:
2525
variance:
2626
$pow:
2727
-
28-
# The builder renders $stdDevPop with the array form, even with a single value
28+
# Example uses the short form, the builder always generates the verbose form
2929
# $stdDevPop: '$scores.score'
3030
$stdDevPop: ['$scores.score']
3131
- 2

generator/config/expression/rand.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ tests:
2323
amount:
2424
$floor: '$amount'
2525
-
26+
# Example uses the short form, the builder always generates the verbose form
2627
# $merge: 'donors'
2728
$merge:
2829
into: 'donors'

generator/config/expression/second.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ tests:
3030
-
3131
$project:
3232
seconds:
33+
# Example uses the short form, the builder always generates the verbose form
3334
# $second: '$date'
3435
$second:
3536
date: '$date'

generator/config/expression/setField.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ tests:
3939
input: '$$ROOT'
4040
value: '$price'
4141
-
42+
# Example uses the short form, the builder always generates the verbose form
4243
# $unset: 'price'
4344
$unset:
4445
- 'price'
@@ -54,6 +55,7 @@ tests:
5455
input: '$$ROOT'
5556
value: '$price'
5657
-
58+
# Example uses the short form, the builder always generates the verbose form
5759
# $unset: 'price'
5860
$unset:
5961
- 'price'

generator/config/expression/size.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ tests:
2424
numberOfColors:
2525
$cond:
2626
if:
27-
# The example in the docs uses the short syntax for $isArray,
28-
# but the aggregation builder always uses the more verbose syntax.
27+
# Example uses the short form, the builder always generates the verbose form
2928
# $isArray: '$colors'
3029
$isArray:
3130
- '$colors'

generator/config/expression/sortArray.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ tests:
101101
a:
102102
sale: true
103103
price: 19
104-
# Decimal128( "10.23" )
105-
- 10.23
104+
- !bson_decimal128 '10.23'
106105
-
107106
a: 'On sale'
108107
sortBy: 1

generator/config/expression/stdDevPop.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ tests:
2222
-
2323
$project:
2424
stdDev:
25+
# Example uses the short form, the builder always generates the verbose form
2526
# $stdDevPop: '$scores.score'
2627
$stdDevPop: ['$scores.score']

generator/config/expression/sum.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ tests:
2222
-
2323
$project:
2424
quizTotal:
25+
# Example uses the short form, the builder always generates the verbose form
2526
# $sum: '$quizzes'
2627
$sum:
2728
- '$quizzes'

generator/config/expression/unsetField.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ tests:
5353
$unsetField:
5454
field: 'euro'
5555
input:
56+
# Example uses the short form, the builder always generates the verbose form
5657
# $getField: 'price'
5758
$getField:
5859
field: 'price'

generator/config/expression/week.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ tests:
3030
-
3131
$project:
3232
week:
33+
# Example uses the short form, the builder always generates the verbose form
3334
# $week: '$date'
3435
$week:
3536
date: '$date'

generator/config/expression/year.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ tests:
3030
-
3131
$project:
3232
year:
33+
# Example uses the short form, the builder always generates the verbose form
3334
# $year: '$date'
3435
$year:
3536
date: '$date'

generator/config/query/type.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,31 @@ tests:
2121
-
2222
$match:
2323
zipCode:
24-
# Example uses the short form, the builder always generated the verbose form
24+
# Example uses the short form, the builder always generates the verbose form
2525
# $type: 2
2626
$type: [2]
2727
-
2828
$match:
2929
zipCode:
30-
# Example uses the short form, the builder always generated the verbose form
30+
# Example uses the short form, the builder always generates the verbose form
3131
# $type: 'string'
3232
$type: ['string']
3333
-
3434
$match:
3535
zipCode:
36-
# Example uses the short form, the builder always generated the verbose form
36+
# Example uses the short form, the builder always generates the verbose form
3737
# $type: 1
3838
$type: [1]
3939
-
4040
$match:
4141
zipCode:
42-
# Example uses the short form, the builder always generated the verbose form
42+
# Example uses the short form, the builder always generates the verbose form
4343
# $type: 'double'
4444
$type: ['double']
4545
-
4646
$match:
4747
zipCode:
48-
# Example uses the short form, the builder always generated the verbose form
48+
# Example uses the short form, the builder always generates the verbose form
4949
# $type: 'number'
5050
$type: ['number']
5151
-
@@ -67,13 +67,13 @@ tests:
6767
-
6868
$match:
6969
zipCode:
70-
# Example uses the short form, the builder always generated the verbose form
70+
# Example uses the short form, the builder always generates the verbose form
7171
# $type: 'minKey'
7272
$type: ['minKey']
7373
-
7474
$match:
7575
zipCode:
76-
# Example uses the short form, the builder always generated the verbose form
76+
# Example uses the short form, the builder always generates the verbose form
7777
# $type: 'maxKey'
7878
$type: ['maxKey']
7979
-
@@ -83,6 +83,6 @@ tests:
8383
-
8484
$match:
8585
zipCode:
86-
# Example uses the short form, the builder always generated the verbose form
86+
# Example uses the short form, the builder always generates the verbose form
8787
# $type: 'array'
8888
$type: ['array']

0 commit comments

Comments
 (0)