Skip to content

Commit e28803d

Browse files
committed
add test schemas for expressions
1 parent cb2571c commit e28803d

File tree

149 files changed

+2930
-28
lines changed

Some content is hidden

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

149 files changed

+2930
-28
lines changed

generator/config/expression/abs.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,14 @@ tests:
2020
$subtract:
2121
- $startTemp
2222
- $endTemp
23+
schema:
24+
temperatureChange:
25+
_id:
26+
types:
27+
- bsonType: Number
28+
startTemp:
29+
types:
30+
- bsonType: Number
31+
endTemp:
32+
types:
33+
- bsonType: Number

generator/config/expression/acos.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,17 @@ tests:
2626
$divide:
2727
- $side_b
2828
- $hypotenuse
29+
schema:
30+
TestCollection:
31+
_id:
32+
types:
33+
- bsonType: ObjectId
34+
side_a:
35+
types:
36+
- bsonType: Decimal128
37+
side_b:
38+
types:
39+
- bsonType: Decimal128
40+
hypotenuse:
41+
types:
42+
- bsonType: Decimal128

generator/config/expression/acosh.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,11 @@ tests:
2323
y-coordinate:
2424
$radiansToDegrees:
2525
$acosh: $x-coordinate
26+
schema:
27+
TestCollection:
28+
_id:
29+
types:
30+
- bsonType: ObjectId
31+
x-coordinate:
32+
types:
33+
- bsonType: Decimal128

generator/config/expression/add.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,23 @@ tests:
2828
$add:
2929
- $price
3030
- $fee
31+
schema:
32+
TestCollection:
33+
_id:
34+
types:
35+
- bsonType: Number
36+
item:
37+
types:
38+
- bsonType: String
39+
price:
40+
types:
41+
- bsonType: Number
42+
fee:
43+
types:
44+
- bsonType: Number
45+
date:
46+
types:
47+
- bsonType: Date
3148
- name: Perform Addition on a Date
3249
link: https://www.mongodb.com/docs/manual/reference/operator/aggregation/add/#perform-addition-on-a-date
3350
pipeline:
@@ -37,3 +54,20 @@ tests:
3754
$add:
3855
- $date
3956
- 259200000
57+
schema:
58+
TestCollection:
59+
_id:
60+
types:
61+
- bsonType: Number
62+
item:
63+
types:
64+
- bsonType: String
65+
price:
66+
types:
67+
- bsonType: Number
68+
fee:
69+
types:
70+
- bsonType: Number
71+
date:
72+
types:
73+
- bsonType: Date

generator/config/expression/allElementsTrue.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,21 @@ tests:
2020
$allElementsTrue:
2121
- $responses
2222
_id: 0
23+
schema:
24+
survey:
25+
_id:
26+
types:
27+
- bsonType: Number
28+
responses:
29+
types:
30+
- bsonType: Array
31+
types:
32+
- bsonType: Boolean
33+
- bsonType: Array
34+
types:
35+
- bsonType: Number
36+
- bsonType: Boolean
37+
- bsonType: Number
38+
- bsonType: String
39+
- bsonType: 'Null'
40+
- bsonType: Undefined

generator/config/expression/and.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,17 @@ tests:
3030
- $lt:
3131
- $qty
3232
- 250
33+
schema:
34+
inventory:
35+
_id:
36+
types:
37+
- bsonType: Number
38+
item:
39+
types:
40+
- bsonType: String
41+
description:
42+
types:
43+
- bsonType: String
44+
qty:
45+
types:
46+
- bsonType: Number

generator/config/expression/anyElementTrue.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,21 @@ tests:
2020
$anyElementTrue:
2121
- $responses
2222
_id: 0
23+
schema:
24+
survey:
25+
_id:
26+
types:
27+
- bsonType: Number
28+
responses:
29+
types:
30+
- bsonType: Array
31+
types:
32+
- bsonType: Boolean
33+
- bsonType: Array
34+
types:
35+
- bsonType: Number
36+
- bsonType: Boolean
37+
- bsonType: Number
38+
- bsonType: String
39+
- bsonType: 'Null'
40+
- bsonType: Undefined

generator/config/expression/arrayElemAt.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,16 @@ tests:
2727
$arrayElemAt:
2828
- $favorites
2929
- -1
30+
schema:
31+
TestCollection:
32+
_id:
33+
types:
34+
- bsonType: Number
35+
name:
36+
types:
37+
- bsonType: String
38+
favorites:
39+
types:
40+
- bsonType: Array
41+
types:
42+
- bsonType: String

generator/config/expression/arrayToObject.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,31 @@ tests:
1919
dimensions:
2020
$arrayToObject:
2121
- $dimensions
22+
schema:
23+
inventory:
24+
_id:
25+
types:
26+
- bsonType: Number
27+
item:
28+
types:
29+
- bsonType: String
30+
dimensions:
31+
types:
32+
- bsonType: Array
33+
types:
34+
- bsonType: Array
35+
types:
36+
- bsonType: String
37+
- bsonType: Number
38+
- bsonType: Document
39+
fields:
40+
k:
41+
types:
42+
- bsonType: String
43+
v:
44+
types:
45+
- bsonType: Number
46+
- bsonType: String
2247
- name: $objectToArray and $arrayToObject Example
2348
link: https://www.mongodb.com/docs/manual/reference/operator/aggregation/arrayToObject/#-objecttoarray----arraytoobject-example
2449
pipeline:
@@ -37,3 +62,24 @@ tests:
3762
instock:
3863
$arrayToObject:
3964
- $instock
65+
schema:
66+
inventory:
67+
_id:
68+
types:
69+
- bsonType: Number
70+
item:
71+
types:
72+
- bsonType: String
73+
instock:
74+
types:
75+
- bsonType: Document
76+
fields:
77+
warehouse1:
78+
types:
79+
- bsonType: Number
80+
warehouse2:
81+
types:
82+
- bsonType: Number
83+
warehouse3:
84+
types:
85+
- bsonType: Number

generator/config/expression/asin.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,17 @@ tests:
2626
$divide:
2727
- $side_a
2828
- $hypotenuse
29+
schema:
30+
TestCollection:
31+
_id:
32+
types:
33+
- bsonType: ObjectId
34+
side_a:
35+
types:
36+
- bsonType: Decimal128
37+
side_b:
38+
types:
39+
- bsonType: Decimal128
40+
hypotenuse:
41+
types:
42+
- bsonType: Decimal128

0 commit comments

Comments
 (0)