1{
2 "description": "unacknowledged-findOneAndUpdate-hint-clientError",
3 "schemaVersion": "1.0",
4 "createEntities": [
5 {
6 "client": {
7 "id": "client0",
8 "observeEvents": [
9 "commandStartedEvent"
10 ]
11 }
12 },
13 {
14 "database": {
15 "id": "database0",
16 "client": "client0",
17 "databaseName": "crud-v2"
18 }
19 },
20 {
21 "collection": {
22 "id": "collection0",
23 "database": "database0",
24 "collectionName": "FindOneAndUpdate_hint",
25 "collectionOptions": {
26 "writeConcern": {
27 "w": 0
28 }
29 }
30 }
31 }
32 ],
33 "initialData": [
34 {
35 "collectionName": "FindOneAndUpdate_hint",
36 "databaseName": "crud-v2",
37 "documents": [
38 {
39 "_id": 1,
40 "x": 11
41 },
42 {
43 "_id": 2,
44 "x": 22
45 }
46 ]
47 }
48 ],
49 "tests": [
50 {
51 "description": "Unacknowledged findOneAndUpdate with hint string fails with client-side error",
52 "operations": [
53 {
54 "object": "collection0",
55 "name": "findOneAndUpdate",
56 "arguments": {
57 "filter": {
58 "_id": 1
59 },
60 "update": {
61 "$inc": {
62 "x": 1
63 }
64 },
65 "hint": "_id_"
66 },
67 "expectError": {
68 "isError": true
69 }
70 }
71 ],
72 "expectEvents": [
73 {
74 "client": "client0",
75 "events": []
76 }
77 ],
78 "outcome": [
79 {
80 "collectionName": "FindOneAndUpdate_hint",
81 "databaseName": "crud-v2",
82 "documents": [
83 {
84 "_id": 1,
85 "x": 11
86 },
87 {
88 "_id": 2,
89 "x": 22
90 }
91 ]
92 }
93 ]
94 },
95 {
96 "description": "Unacknowledged findOneAndUpdate with hint document fails with client-side error",
97 "operations": [
98 {
99 "object": "collection0",
100 "name": "findOneAndUpdate",
101 "arguments": {
102 "filter": {
103 "_id": 1
104 },
105 "update": {
106 "$inc": {
107 "x": 1
108 }
109 },
110 "hint": {
111 "_id": 1
112 }
113 },
114 "expectError": {
115 "isError": true
116 }
117 }
118 ],
119 "expectEvents": [
120 {
121 "client": "client0",
122 "events": []
123 }
124 ],
125 "outcome": [
126 {
127 "collectionName": "FindOneAndUpdate_hint",
128 "databaseName": "crud-v2",
129 "documents": [
130 {
131 "_id": 1,
132 "x": 11
133 },
134 {
135 "_id": 2,
136 "x": 22
137 }
138 ]
139 }
140 ]
141 }
142 ]
143}
View as plain text