Skip to content

Commit fd06dd6

Browse files
committed
add test schemas for query
1 parent e28803d commit fd06dd6

35 files changed

+997
-65
lines changed

generator/config/query/all.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,34 @@ tests:
2121
- appliance
2222
- school
2323
- book
24+
schema:
25+
inventory:
26+
_id:
27+
types:
28+
- bsonType: ObjectId
29+
code:
30+
types:
31+
- bsonType: String
32+
tags:
33+
types:
34+
- bsonType: Array
35+
types:
36+
- bsonType: String
37+
qty:
38+
types:
39+
- bsonType: Array
40+
types:
41+
- bsonType: Document
42+
fields:
43+
size:
44+
types:
45+
- bsonType: String
46+
num:
47+
types:
48+
- bsonType: Number
49+
color:
50+
types:
51+
- bsonType: String
2452
- name: Use $all with $elemMatch
2553
link: https://www.mongodb.com/docs/manual/reference/operator/query/all/#use--all-with--elemmatch
2654
pipeline:
@@ -34,3 +62,31 @@ tests:
3462
- $elemMatch:
3563
num: 100
3664
color: green
65+
schema:
66+
inventory:
67+
_id:
68+
types:
69+
- bsonType: ObjectId
70+
code:
71+
types:
72+
- bsonType: String
73+
tags:
74+
types:
75+
- bsonType: Array
76+
types:
77+
- bsonType: String
78+
qty:
79+
types:
80+
- bsonType: Array
81+
types:
82+
- bsonType: Document
83+
fields:
84+
size:
85+
types:
86+
- bsonType: String
87+
num:
88+
types:
89+
- bsonType: Number
90+
color:
91+
types:
92+
- bsonType: String

generator/config/query/and.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ tests:
2222
$ne: 1.99
2323
- price:
2424
$exists: true
25+
schema:
26+
inventory:
27+
price:
28+
types:
29+
- bsonType: Double
2530
- name: AND Queries With Multiple Expressions Specifying the Same Operator
2631
link: https://www.mongodb.com/docs/manual/reference/operator/query/and/#and-queries-with-multiple-expressions-specifying-the-same-operator
2732
pipeline:
@@ -36,3 +41,14 @@ tests:
3641
- sale: true
3742
- price:
3843
$lt: 5
44+
schema:
45+
inventory:
46+
price:
47+
types:
48+
- bsonType: Double
49+
qty:
50+
types:
51+
- bsonType: Int32
52+
sale:
53+
types:
54+
- bsonType: Boolean

generator/config/query/bitsAllClear.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,51 @@ tests:
2121
$bitsAllClear:
2222
- 1
2323
- 5
24+
schema:
25+
collection:
26+
_id:
27+
types:
28+
- bsonType: Number
29+
a:
30+
types:
31+
- bsonType: Number
32+
- bsonType: Binary
33+
binaryValueofA:
34+
types:
35+
- bsonType: String
2436
- name: Integer Bitmask
2537
link: https://www.mongodb.com/docs/manual/reference/operator/query/bitsAllClear/#integer-bitmask
2638
pipeline:
2739
- $match:
2840
a:
2941
$bitsAllClear: 35
42+
schema:
43+
collection:
44+
_id:
45+
types:
46+
- bsonType: Number
47+
a:
48+
types:
49+
- bsonType: Number
50+
- bsonType: Binary
51+
binaryValueofA:
52+
types:
53+
- bsonType: String
3054
- name: BinData Bitmask
3155
link: https://www.mongodb.com/docs/manual/reference/operator/query/bitsAllClear/#bindata-bitmask
3256
pipeline:
3357
- $match:
3458
a:
3559
$bitsAllClear: !bson_binary IA==
60+
schema:
61+
collection:
62+
_id:
63+
types:
64+
- bsonType: Number
65+
a:
66+
types:
67+
- bsonType: Number
68+
- bsonType: Binary
69+
binaryValueofA:
70+
types:
71+
- bsonType: String

generator/config/query/bitsAllSet.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,51 @@ tests:
2121
$bitsAllSet:
2222
- 1
2323
- 5
24+
schema:
25+
collection:
26+
_id:
27+
types:
28+
- bsonType: Number
29+
a:
30+
types:
31+
- bsonType: Number
32+
- bsonType: Binary
33+
binaryValueofA:
34+
types:
35+
- bsonType: String
2436
- name: Integer Bitmask
2537
link: https://www.mongodb.com/docs/manual/reference/operator/query/bitsAllSet/#integer-bitmask
2638
pipeline:
2739
- $match:
2840
a:
2941
$bitsAllSet: 50
42+
schema:
43+
collection:
44+
_id:
45+
types:
46+
- bsonType: Number
47+
a:
48+
types:
49+
- bsonType: Number
50+
- bsonType: Binary
51+
binaryValueofA:
52+
types:
53+
- bsonType: String
3054
- name: BinData Bitmask
3155
link: https://www.mongodb.com/docs/manual/reference/operator/query/bitsAllSet/#bindata-bitmask
3256
pipeline:
3357
- $match:
3458
a:
3559
$bitsAllSet: !bson_binary MA==
60+
schema:
61+
collection:
62+
_id:
63+
types:
64+
- bsonType: Number
65+
a:
66+
types:
67+
- bsonType: Number
68+
- bsonType: Binary
69+
binaryValueofA:
70+
types:
71+
- bsonType: String

generator/config/query/bitsAnyClear.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,51 @@ tests:
2121
$bitsAnyClear:
2222
- 1
2323
- 5
24+
schema:
25+
collection:
26+
_id:
27+
types:
28+
- bsonType: Number
29+
a:
30+
types:
31+
- bsonType: Number
32+
- bsonType: Binary
33+
binaryValueofA:
34+
types:
35+
- bsonType: String
2436
- name: Integer Bitmask
2537
link: https://www.mongodb.com/docs/manual/reference/operator/query/bitsAnyClear/#integer-bitmask
2638
pipeline:
2739
- $match:
2840
a:
2941
$bitsAnyClear: 35
42+
schema:
43+
collection:
44+
_id:
45+
types:
46+
- bsonType: Number
47+
a:
48+
types:
49+
- bsonType: Number
50+
- bsonType: Binary
51+
binaryValueofA:
52+
types:
53+
- bsonType: String
3054
- name: BinData Bitmask
3155
link: https://www.mongodb.com/docs/manual/reference/operator/query/bitsAnyClear/#bindata-bitmask
3256
pipeline:
3357
- $match:
3458
a:
3559
$bitsAnyClear: !bson_binary MA==
60+
schema:
61+
collection:
62+
_id:
63+
types:
64+
- bsonType: Number
65+
a:
66+
types:
67+
- bsonType: Number
68+
- bsonType: Binary
69+
binaryValueofA:
70+
types:
71+
- bsonType: String

generator/config/query/bitsAnySet.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,51 @@ tests:
2121
$bitsAnySet:
2222
- 1
2323
- 5
24+
schema:
25+
collection:
26+
_id:
27+
types:
28+
- bsonType: Number
29+
a:
30+
types:
31+
- bsonType: Number
32+
- bsonType: Binary
33+
binaryValueofA:
34+
types:
35+
- bsonType: String
2436
- name: Integer Bitmask
2537
link: https://www.mongodb.com/docs/manual/reference/operator/query/bitsAnySet/#integer-bitmask
2638
pipeline:
2739
- $match:
2840
a:
2941
$bitsAnySet: 35
42+
schema:
43+
collection:
44+
_id:
45+
types:
46+
- bsonType: Number
47+
a:
48+
types:
49+
- bsonType: Number
50+
- bsonType: Binary
51+
binaryValueofA:
52+
types:
53+
- bsonType: String
3054
- name: BinData Bitmask
3155
link: https://www.mongodb.com/docs/manual/reference/operator/query/bitsAnySet/#bindata-bitmask
3256
pipeline:
3357
- $match:
3458
a:
3559
$bitsAnySet: !bson_binary MA==
60+
schema:
61+
collection:
62+
_id:
63+
types:
64+
- bsonType: Number
65+
a:
66+
types:
67+
- bsonType: Number
68+
- bsonType: Binary
69+
binaryValueofA:
70+
types:
71+
- bsonType: String

generator/config/query/comment.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)