Skip to content

Commit 691b9df

Browse files
author
Divjot Arora
authored
GODRIVER-1585 Error for hints with unacknowledged writes (#395)
1 parent 8fe756a commit 691b9df

32 files changed

+1745
-89
lines changed
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
{
2+
"data": [
3+
{
4+
"_id": 1,
5+
"x": 11
6+
},
7+
{
8+
"_id": 2,
9+
"x": 22
10+
},
11+
{
12+
"_id": 3,
13+
"x": 33
14+
},
15+
{
16+
"_id": 4,
17+
"x": 44
18+
}
19+
],
20+
"collection_name": "BulkWrite_delete_hint",
21+
"tests": [
22+
{
23+
"description": "Unacknowledged bulkWrite deleteOne with hints fails with client-side error",
24+
"operations": [
25+
{
26+
"name": "bulkWrite",
27+
"collectionOptions": {
28+
"writeConcern": {
29+
"w": 0
30+
}
31+
},
32+
"arguments": {
33+
"requests": [
34+
{
35+
"name": "deleteOne",
36+
"arguments": {
37+
"filter": {
38+
"_id": 1
39+
},
40+
"hint": "_id_"
41+
}
42+
},
43+
{
44+
"name": "deleteOne",
45+
"arguments": {
46+
"filter": {
47+
"_id": 2
48+
},
49+
"hint": {
50+
"_id": 1
51+
}
52+
}
53+
}
54+
],
55+
"options": {
56+
"ordered": true
57+
}
58+
},
59+
"error": true
60+
}
61+
],
62+
"expectations": [],
63+
"outcome": {
64+
"collection": {
65+
"data": [
66+
{
67+
"_id": 1,
68+
"x": 11
69+
},
70+
{
71+
"_id": 2,
72+
"x": 22
73+
},
74+
{
75+
"_id": 3,
76+
"x": 33
77+
},
78+
{
79+
"_id": 4,
80+
"x": 44
81+
}
82+
]
83+
}
84+
}
85+
},
86+
{
87+
"description": "Unacknowledged bulkWrite deleteMany with hints fails with client-side error",
88+
"operations": [
89+
{
90+
"name": "bulkWrite",
91+
"collectionOptions": {
92+
"writeConcern": {
93+
"w": 0
94+
}
95+
},
96+
"arguments": {
97+
"requests": [
98+
{
99+
"name": "deleteMany",
100+
"arguments": {
101+
"filter": {
102+
"_id": {
103+
"$lt": 3
104+
}
105+
},
106+
"hint": "_id_"
107+
}
108+
},
109+
{
110+
"name": "deleteMany",
111+
"arguments": {
112+
"filter": {
113+
"_id": {
114+
"$gte": 4
115+
}
116+
},
117+
"hint": {
118+
"_id": 1
119+
}
120+
}
121+
}
122+
],
123+
"options": {
124+
"ordered": true
125+
}
126+
},
127+
"error": true
128+
}
129+
],
130+
"expectations": [],
131+
"outcome": {
132+
"collection": {
133+
"data": [
134+
{
135+
"_id": 1,
136+
"x": 11
137+
},
138+
{
139+
"_id": 2,
140+
"x": 22
141+
},
142+
{
143+
"_id": 3,
144+
"x": 33
145+
},
146+
{
147+
"_id": 4,
148+
"x": 44
149+
}
150+
]
151+
}
152+
}
153+
}
154+
]
155+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
data:
2+
- {_id: 1, x: 11}
3+
- {_id: 2, x: 22}
4+
- {_id: 3, x: 33}
5+
- {_id: 4, x: 44}
6+
7+
collection_name: &collection_name 'BulkWrite_delete_hint'
8+
9+
tests:
10+
-
11+
description: "Unacknowledged bulkWrite deleteOne with hints fails with client-side error"
12+
operations:
13+
-
14+
name: "bulkWrite"
15+
collectionOptions: &collection_options
16+
writeConcern: { w: 0 }
17+
arguments:
18+
requests:
19+
-
20+
name: "deleteOne"
21+
arguments:
22+
filter: &deleteOne_filter1 { _id: 1 }
23+
hint: &hint_string "_id_"
24+
-
25+
name: "deleteOne"
26+
arguments:
27+
filter: &deleteOne_filter2 { _id: 2 }
28+
hint: &hint_doc { _id: 1 }
29+
options: { ordered: true }
30+
error: true
31+
expectations: []
32+
outcome: &outcome
33+
collection:
34+
data:
35+
- {_id: 1, x: 11 }
36+
- {_id: 2, x: 22 }
37+
- {_id: 3, x: 33 }
38+
- {_id: 4, x: 44 }
39+
-
40+
description: "Unacknowledged bulkWrite deleteMany with hints fails with client-side error"
41+
operations:
42+
-
43+
name: "bulkWrite"
44+
collectionOptions: *collection_options
45+
arguments:
46+
requests:
47+
-
48+
name: "deleteMany"
49+
arguments:
50+
filter: &deleteMany_filter1 { _id: { $lt: 3 } }
51+
hint: *hint_string
52+
-
53+
name: "deleteMany"
54+
arguments:
55+
filter: &deleteMany_filter2 { _id: { $gte: 4 } }
56+
hint: *hint_doc
57+
options: { ordered: true }
58+
error: true
59+
expectations: []
60+
outcome: *outcome

0 commit comments

Comments
 (0)