Debian Codegraph @

testdata/transactions/legacy/reads.yml

raw symbols SCIP
1 runOn:
2 -
3 minServerVersion: "4.0"
4 topology: ["replicaset"]
5 -
6 minServerVersion: "4.1.8"
7 topology: ["sharded"]
8
9 database_name: &database_name "transaction-tests"
10 collection_name: &collection_name "test"
11
12 data: &data
13 - {_id: 1}
14 - {_id: 2}
15 - {_id: 3}
16 - {_id: 4}
17
18 tests:
19 - description: collection readConcern without transaction
20
21 operations:
22 - name: find
23 object: collection
24 collectionOptions:
25 readConcern:
26 level: majority
27 arguments:
28 session: session0
29 result: *data
30
31 expectations:
32 - command_started_event:
33 command:
34 find: *collection_name
35 readConcern:
36 level: majority
37 lsid: session0
38 txnNumber:
39 startTransaction:
40 autocommit:
41 command_name: find
42 database_name: *database_name
43
44 outcome: &outcome
45 collection:
46 data:
47 *data
48
49 - description: find
50
51 operations:
52 - &startTransaction
53 name: startTransaction
54 object: session0
55 - &find
56 name: find
57 object: collection
58 arguments:
59 session: session0
60 batchSize: 3
61 result: *data
62 - *find
63 - &commitTransaction
64 name: commitTransaction
65 object: session0
66
67 expectations:
68 - command_started_event:
69 command:
70 find: *collection_name
71 batchSize: 3
72 readConcern:
73 lsid: session0
74 txnNumber:
75 $numberLong: "1"
76 startTransaction: true
77 autocommit: false
78 command_name: find
79 database_name: *database_name
80 - command_started_event:
81 command:
82 getMore:
83 # 42 is a fake placeholder value for the cursorId.
84 $numberLong: '42'
85 collection: *collection_name
86 batchSize: 3
87 lsid: session0
88 txnNumber:
89 $numberLong: "1"
90 startTransaction:
91 autocommit: false
92 command_name: getMore
93 database_name: *database_name
94 - command_started_event:
95 command:
96 find: *collection_name
97 batchSize: 3
98 lsid: session0
99 txnNumber:
100 $numberLong: "1"
101 startTransaction:
102 autocommit: false
103 command_name: find
104 database_name: *database_name
105 - command_started_event:
106 command:
107 getMore:
108 $numberLong: '42'
109 collection: *collection_name
110 batchSize: 3
111 lsid: session0
112 txnNumber:
113 $numberLong: "1"
114 startTransaction:
115 autocommit: false
116 command_name: getMore
117 database_name: *database_name
118 - command_started_event:
119 command:
120 commitTransaction: 1
121 lsid: session0
122 txnNumber:
123 $numberLong: "1"
124 startTransaction:
125 autocommit: false
126 writeConcern:
127 command_name: commitTransaction
128 database_name: admin
129
130 outcome: *outcome
131
132 - description: aggregate
133
134 operations:
135 - *startTransaction
136 - &aggregate
137 name: aggregate
138 object: collection
139 arguments:
140 pipeline:
141 - $project:
142 _id: 1
143 batchSize: 3
144 session: session0
145 result: *data
146 - *aggregate
147 - *commitTransaction
148
149 expectations:
150 - command_started_event:
151 command:
152 aggregate: *collection_name
153 pipeline:
154 - $project:
155 _id: 1
156 cursor:
157 batchSize: 3
158 readConcern:
159 lsid: session0
160 txnNumber:
161 $numberLong: "1"
162 startTransaction: true
163 autocommit: false
164 command_name: aggregate
165 database_name: *database_name
166 - command_started_event:
167 command:
168 getMore:
169 # 42 is a fake placeholder value for the cursorId.
170 $numberLong: '42'
171 collection: *collection_name
172 batchSize: 3
173 lsid: session0
174 txnNumber:
175 $numberLong: "1"
176 startTransaction:
177 autocommit: false
178 command_name: getMore
179 database_name: *database_name
180 - command_started_event:
181 command:
182 aggregate: *collection_name
183 pipeline:
184 - $project:
185 _id: 1
186 cursor:
187 batchSize: 3
188 lsid: session0
189 txnNumber:
190 $numberLong: "1"
191 startTransaction:
192 autocommit: false
193 command_name: aggregate
194 database_name: *database_name
195 - command_started_event:
196 command:
197 getMore:
198 $numberLong: '42'
199 collection: *collection_name
200 batchSize: 3
201 lsid: session0
202 txnNumber:
203 $numberLong: "1"
204 startTransaction:
205 autocommit: false
206 command_name: getMore
207 database_name: *database_name
208 - command_started_event:
209 command:
210 commitTransaction: 1
211 lsid: session0
212 txnNumber:
213 $numberLong: "1"
214 startTransaction:
215 autocommit: false
216 writeConcern:
217 command_name: commitTransaction
218 database_name: admin
219
220 outcome: *outcome
221
222 - description: distinct
223
224 operations:
225 - *startTransaction
226 - name: distinct
227 object: collection
228 arguments:
229 session: session0
230 fieldName: _id
231 result: [1, 2, 3, 4]
232 - *commitTransaction
233
234 expectations:
235 - command_started_event:
236 command:
237 distinct: *collection_name
238 key: _id
239 lsid: session0
240 readConcern:
241 txnNumber:
242 $numberLong: "1"
243 startTransaction: true
244 autocommit: false
245 writeConcern:
246 command_name: distinct
247 database_name: *database_name
248 - command_started_event:
249 command:
250 commitTransaction: 1
251 lsid: session0
252 readConcern:
253 txnNumber:
254 $numberLong: "1"
255 startTransaction:
256 autocommit: false
257 writeConcern:
258 command_name: commitTransaction
259 database_name: admin
260
261 outcome: *outcome