...
1# This file was created automatically using mongodb-spec-converter.
2# Please review the generated file, then remove this notice.
3
4description: updateMany-hint
5schemaVersion: '1.0'
6runOnRequirements:
7 -
8 minServerVersion: 4.2.0
9createEntities:
10 -
11 client:
12 id: &client0 client0
13 observeEvents:
14 - commandStartedEvent
15 -
16 database:
17 id: &database0 database0
18 client: client0
19 databaseName: &database_name crud-v2
20 -
21 collection:
22 id: &collection0 collection0
23 database: database0
24 collectionName: &collection_name test_updatemany_hint
25initialData:
26 -
27 collectionName: *collection_name
28 databaseName: *database_name
29 documents:
30 -
31 _id: 1
32 x: 11
33 -
34 _id: 2
35 x: 22
36 -
37 _id: 3
38 x: 33
39tests:
40 -
41 description: 'UpdateMany with hint string'
42 operations:
43 -
44 object: *collection0
45 name: updateMany
46 arguments:
47 filter: &filter
48 _id:
49 $gt: 1
50 update: &update
51 $inc:
52 x: 1
53 hint: _id_
54 expectResult: &result
55 matchedCount: 2
56 modifiedCount: 2
57 upsertedCount: 0
58 expectEvents:
59 -
60 client: *client0
61 events:
62 -
63 commandStartedEvent:
64 command:
65 update: *collection_name
66 updates:
67 -
68 q: *filter
69 u: *update
70 multi: true
71 hint: _id_
72 upsert: { $$unsetOrMatches: false }
73 outcome: &outcome
74 -
75 collectionName: *collection_name
76 databaseName: *database_name
77 documents:
78 -
79 _id: 1
80 x: 11
81 -
82 _id: 2
83 x: 23
84 -
85 _id: 3
86 x: 34
87 -
88 description: 'UpdateMany with hint document'
89 operations:
90 -
91 object: *collection0
92 name: updateMany
93 arguments:
94 filter: *filter
95 update: *update
96 hint:
97 _id: 1
98 expectResult: *result
99 expectEvents:
100 -
101 client: *client0
102 events:
103 -
104 commandStartedEvent:
105 command:
106 update: *collection_name
107 updates:
108 -
109 q: *filter
110 u: *update
111 multi: true
112 hint:
113 _id: 1
114 upsert: { $$unsetOrMatches: false }
115 outcome: *outcome
View as plain text