File tree Expand file tree Collapse file tree 7 files changed +534
-13
lines changed Expand file tree Collapse file tree 7 files changed +534
-13
lines changed Original file line number Diff line number Diff line change 9
9
"tests" : [
10
10
{
11
11
"description" : " foo" ,
12
- "operations" : [
13
-
14
- ]
12
+ "operations" : []
15
13
}
16
14
]
17
15
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "description" : " operator-matchAsDocument" ,
3
+ "schemaVersion" : " 1.13" ,
4
+ "createEntities" : [
5
+ {
6
+ "client" : {
7
+ "id" : " client0"
8
+ }
9
+ },
10
+ {
11
+ "database" : {
12
+ "id" : " database0" ,
13
+ "client" : " client0" ,
14
+ "databaseName" : " test"
15
+ }
16
+ },
17
+ {
18
+ "collection" : {
19
+ "id" : " collection0" ,
20
+ "database" : " database0" ,
21
+ "collectionName" : " coll0"
22
+ }
23
+ }
24
+ ],
25
+ "initialData" : [
26
+ {
27
+ "collectionName" : " coll0" ,
28
+ "databaseName" : " test" ,
29
+ "documents" : [
30
+ {
31
+ "_id" : 1 ,
32
+ "json" : " { \" x\" : 1, \" y\" : 2 }"
33
+ },
34
+ {
35
+ "_id" : 2 ,
36
+ "json" : " { \" x\" }"
37
+ }
38
+ ]
39
+ }
40
+ ],
41
+ "tests" : [
42
+ {
43
+ "description" : " matchAsDocument with non-matching filter" ,
44
+ "operations" : [
45
+ {
46
+ "name" : " find" ,
47
+ "object" : " collection0" ,
48
+ "arguments" : {
49
+ "filter" : {
50
+ "_id" : 1
51
+ },
52
+ "limit" : 1
53
+ },
54
+ "expectResult" : [
55
+ {
56
+ "_id" : 1 ,
57
+ "json" : {
58
+ "$$matchAsDocument" : {
59
+ "x" : 1 ,
60
+ "y" : " two"
61
+ }
62
+ }
63
+ }
64
+ ]
65
+ }
66
+ ]
67
+ },
68
+ {
69
+ "description" : " matchAsDocument evaluates special operators" ,
70
+ "operations" : [
71
+ {
72
+ "name" : " find" ,
73
+ "object" : " collection0" ,
74
+ "arguments" : {
75
+ "filter" : {
76
+ "_id" : 1
77
+ },
78
+ "limit" : 1
79
+ },
80
+ "expectResult" : [
81
+ {
82
+ "_id" : 1 ,
83
+ "json" : {
84
+ "$$matchAsDocument" : {
85
+ "x" : 1 ,
86
+ "y" : {
87
+ "$$exists" : false
88
+ }
89
+ }
90
+ }
91
+ }
92
+ ]
93
+ }
94
+ ]
95
+ },
96
+ {
97
+ "description" : " matchAsDocument does not permit extra fields" ,
98
+ "operations" : [
99
+ {
100
+ "name" : " find" ,
101
+ "object" : " collection0" ,
102
+ "arguments" : {
103
+ "filter" : {
104
+ "_id" : 1
105
+ },
106
+ "limit" : 1
107
+ },
108
+ "expectResult" : [
109
+ {
110
+ "_id" : 1 ,
111
+ "json" : {
112
+ "$$matchAsDocument" : {
113
+ "x" : 1
114
+ }
115
+ }
116
+ }
117
+ ]
118
+ }
119
+ ]
120
+ },
121
+ {
122
+ "description" : " matchAsDocument fails to decode Extended JSON" ,
123
+ "operations" : [
124
+ {
125
+ "name" : " find" ,
126
+ "object" : " collection0" ,
127
+ "arguments" : {
128
+ "filter" : {
129
+ "_id" : 2
130
+ },
131
+ "limit" : 1
132
+ },
133
+ "expectResult" : [
134
+ {
135
+ "_id" : 2 ,
136
+ "json" : {
137
+ "$$matchAsDocument" : {
138
+ "x" : 1
139
+ }
140
+ }
141
+ }
142
+ ]
143
+ }
144
+ ]
145
+ }
146
+ ]
147
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "description" : " operator-matchAsRoot" ,
3
+ "schemaVersion" : " 1.13" ,
4
+ "createEntities" : [
5
+ {
6
+ "client" : {
7
+ "id" : " client0"
8
+ }
9
+ },
10
+ {
11
+ "database" : {
12
+ "id" : " database0" ,
13
+ "client" : " client0" ,
14
+ "databaseName" : " test"
15
+ }
16
+ },
17
+ {
18
+ "collection" : {
19
+ "id" : " collection0" ,
20
+ "database" : " database0" ,
21
+ "collectionName" : " coll0"
22
+ }
23
+ }
24
+ ],
25
+ "initialData" : [
26
+ {
27
+ "collectionName" : " coll0" ,
28
+ "databaseName" : " test" ,
29
+ "documents" : [
30
+ {
31
+ "_id" : 1 ,
32
+ "x" : {
33
+ "y" : 2 ,
34
+ "z" : 3
35
+ }
36
+ },
37
+ {
38
+ "_id" : 2 ,
39
+ "x" : " { \" x\" : 1, \" y\" : 2.0 }"
40
+ }
41
+ ]
42
+ }
43
+ ],
44
+ "tests" : [
45
+ {
46
+ "description" : " matchAsRoot with nested document" ,
47
+ "operations" : [
48
+ {
49
+ "name" : " find" ,
50
+ "object" : " collection0" ,
51
+ "arguments" : {
52
+ "filter" : {
53
+ "_id" : 1
54
+ },
55
+ "limit" : 1
56
+ },
57
+ "expectResult" : [
58
+ {
59
+ "_id" : 1 ,
60
+ "x" : {
61
+ "$$matchAsRoot" : {
62
+ "y" : 3
63
+ }
64
+ }
65
+ }
66
+ ]
67
+ }
68
+ ]
69
+ },
70
+ {
71
+ "description" : " matchAsRoot with matchAsDocument" ,
72
+ "operations" : [
73
+ {
74
+ "name" : " find" ,
75
+ "object" : " collection0" ,
76
+ "arguments" : {
77
+ "filter" : {
78
+ "_id" : 1
79
+ },
80
+ "limit" : 1
81
+ },
82
+ "expectResult" : [
83
+ {
84
+ "_id" : 2 ,
85
+ "x" : {
86
+ "$$matchAsDocument" : {
87
+ "$$matchAsRoot" : {
88
+ "x" : 1
89
+ }
90
+ }
91
+ }
92
+ }
93
+ ]
94
+ }
95
+ ]
96
+ }
97
+ ]
98
+ }
Original file line number Diff line number Diff line change 1
1
{
2
- "description" : " matches -lte-operator " ,
2
+ "description" : " operator -lte" ,
3
3
"schemaVersion" : " 1.9" ,
4
4
"createEntities" : [
5
5
{
Original file line number Diff line number Diff line change
1
+ {
2
+ "description" : " operator-matchAsDocument" ,
3
+ "schemaVersion" : " 1.13" ,
4
+ "createEntities" : [
5
+ {
6
+ "client" : {
7
+ "id" : " client0"
8
+ }
9
+ },
10
+ {
11
+ "database" : {
12
+ "id" : " database0" ,
13
+ "client" : " client0" ,
14
+ "databaseName" : " test"
15
+ }
16
+ },
17
+ {
18
+ "collection" : {
19
+ "id" : " collection0" ,
20
+ "database" : " database0" ,
21
+ "collectionName" : " coll0"
22
+ }
23
+ }
24
+ ],
25
+ "initialData" : [
26
+ {
27
+ "collectionName" : " coll0" ,
28
+ "databaseName" : " test" ,
29
+ "documents" : [
30
+ {
31
+ "_id" : 1 ,
32
+ "json" : " { \" x\" : 1, \" y\" : 2.0 }"
33
+ },
34
+ {
35
+ "_id" : 2 ,
36
+ "json" : " { \" x\" : { \" $oid\" : \" 57e193d7a9cc81b4027498b5\" } }"
37
+ }
38
+ ]
39
+ }
40
+ ],
41
+ "tests" : [
42
+ {
43
+ "description" : " matchAsDocument performs flexible numeric comparisons" ,
44
+ "operations" : [
45
+ {
46
+ "name" : " find" ,
47
+ "object" : " collection0" ,
48
+ "arguments" : {
49
+ "filter" : {
50
+ "_id" : 1
51
+ },
52
+ "limit" : 1
53
+ },
54
+ "expectResult" : [
55
+ {
56
+ "_id" : 1 ,
57
+ "json" : {
58
+ "$$matchAsDocument" : {
59
+ "x" : 1 ,
60
+ "y" : 2
61
+ }
62
+ }
63
+ }
64
+ ]
65
+ }
66
+ ]
67
+ },
68
+ {
69
+ "description" : " matchAsDocument evaluates special operators" ,
70
+ "operations" : [
71
+ {
72
+ "name" : " find" ,
73
+ "object" : " collection0" ,
74
+ "arguments" : {
75
+ "filter" : {
76
+ "_id" : 1
77
+ },
78
+ "limit" : 1
79
+ },
80
+ "expectResult" : [
81
+ {
82
+ "_id" : 1 ,
83
+ "json" : {
84
+ "$$matchAsDocument" : {
85
+ "x" : 1 ,
86
+ "y" : {
87
+ "$$exists" : true
88
+ }
89
+ }
90
+ }
91
+ }
92
+ ]
93
+ }
94
+ ]
95
+ },
96
+ {
97
+ "description" : " matchAsDocument decodes Extended JSON" ,
98
+ "operations" : [
99
+ {
100
+ "name" : " find" ,
101
+ "object" : " collection0" ,
102
+ "arguments" : {
103
+ "filter" : {
104
+ "_id" : 2
105
+ },
106
+ "limit" : 1
107
+ },
108
+ "expectResult" : [
109
+ {
110
+ "_id" : 2 ,
111
+ "json" : {
112
+ "$$matchAsDocument" : {
113
+ "x" : {
114
+ "$$type" : " objectId"
115
+ }
116
+ }
117
+ }
118
+ }
119
+ ]
120
+ }
121
+ ]
122
+ }
123
+ ]
124
+ }
You can’t perform that action at this time.
0 commit comments