Skip to content

Commit 0e716f1

Browse files
committed
PHPLIB-555: Sync spec tests for array filters
1 parent ce6edcc commit 0e716f1

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"runOn": [
3+
{
4+
"maxServerVersion": "3.5.5"
5+
}
6+
],
7+
"data": [
8+
{
9+
"_id": 1,
10+
"y": [
11+
{
12+
"b": 3
13+
},
14+
{
15+
"b": 1
16+
}
17+
]
18+
},
19+
{
20+
"_id": 2,
21+
"y": [
22+
{
23+
"b": 0
24+
},
25+
{
26+
"b": 1
27+
}
28+
]
29+
}
30+
],
31+
"tests": [
32+
{
33+
"description": "BulkWrite on server that doesn't support arrayFilters",
34+
"operations": [
35+
{
36+
"name": "bulkWrite",
37+
"arguments": {
38+
"requests": [
39+
{
40+
"name": "updateOne",
41+
"arguments": {
42+
"filter": {},
43+
"update": {
44+
"$set": {
45+
"y.0.b": 2
46+
}
47+
},
48+
"arrayFilters": [
49+
{
50+
"i.b": 1
51+
}
52+
]
53+
}
54+
}
55+
],
56+
"options": {
57+
"ordered": true
58+
}
59+
},
60+
"error": true
61+
}
62+
],
63+
"expectations": []
64+
},
65+
{
66+
"description": "BulkWrite on server that doesn't support arrayFilters with arrayFilters on second op",
67+
"operations": [
68+
{
69+
"name": "bulkWrite",
70+
"arguments": {
71+
"requests": [
72+
{
73+
"name": "updateOne",
74+
"arguments": {
75+
"filter": {},
76+
"update": {
77+
"$set": {
78+
"y.0.b": 2
79+
}
80+
}
81+
}
82+
},
83+
{
84+
"name": "updateMany",
85+
"arguments": {
86+
"filter": {},
87+
"update": {
88+
"$set": {
89+
"y.$[i].b": 2
90+
}
91+
},
92+
"arrayFilters": [
93+
{
94+
"i.b": 1
95+
}
96+
]
97+
}
98+
}
99+
],
100+
"options": {
101+
"ordered": true
102+
}
103+
},
104+
"error": true
105+
}
106+
],
107+
"expectations": []
108+
}
109+
]
110+
}

0 commit comments

Comments
 (0)