1{
2 "description": "findOneAndUpdate-hint",
3 "schemaVersion": "1.0",
4 "runOnRequirements": [
5 {
6 "minServerVersion": "4.3.1"
7 }
8 ],
9 "createEntities": [
10 {
11 "client": {
12 "id": "client0",
13 "observeEvents": [
14 "commandStartedEvent"
15 ]
16 }
17 },
18 {
19 "database": {
20 "id": "database0",
21 "client": "client0",
22 "databaseName": "crud-v2"
23 }
24 },
25 {
26 "collection": {
27 "id": "collection0",
28 "database": "database0",
29 "collectionName": "findOneAndUpdate_hint"
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": "FindOneAndUpdate with hint string",
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 "expectResult": {
68 "_id": 1,
69 "x": 11
70 }
71 }
72 ],
73 "expectEvents": [
74 {
75 "client": "client0",
76 "events": [
77 {
78 "commandStartedEvent": {
79 "command": {
80 "findAndModify": "findOneAndUpdate_hint",
81 "query": {
82 "_id": 1
83 },
84 "update": {
85 "$inc": {
86 "x": 1
87 }
88 },
89 "hint": "_id_"
90 }
91 }
92 }
93 ]
94 }
95 ],
96 "outcome": [
97 {
98 "collectionName": "findOneAndUpdate_hint",
99 "databaseName": "crud-v2",
100 "documents": [
101 {
102 "_id": 1,
103 "x": 12
104 },
105 {
106 "_id": 2,
107 "x": 22
108 }
109 ]
110 }
111 ]
112 },
113 {
114 "description": "FindOneAndUpdate with hint document",
115 "operations": [
116 {
117 "object": "collection0",
118 "name": "findOneAndUpdate",
119 "arguments": {
120 "filter": {
121 "_id": 1
122 },
123 "update": {
124 "$inc": {
125 "x": 1
126 }
127 },
128 "hint": {
129 "_id": 1
130 }
131 },
132 "expectResult": {
133 "_id": 1,
134 "x": 11
135 }
136 }
137 ],
138 "expectEvents": [
139 {
140 "client": "client0",
141 "events": [
142 {
143 "commandStartedEvent": {
144 "command": {
145 "findAndModify": "findOneAndUpdate_hint",
146 "query": {
147 "_id": 1
148 },
149 "update": {
150 "$inc": {
151 "x": 1
152 }
153 },
154 "hint": {
155 "_id": 1
156 }
157 }
158 }
159 }
160 ]
161 }
162 ],
163 "outcome": [
164 {
165 "collectionName": "findOneAndUpdate_hint",
166 "databaseName": "crud-v2",
167 "documents": [
168 {
169 "_id": 1,
170 "x": 12
171 },
172 {
173 "_id": 2,
174 "x": 22
175 }
176 ]
177 }
178 ]
179 }
180 ]
181}
View as plain text