...
1# This file was created automatically using mongodb-spec-converter.
2# Please review the generated file, then remove this notice.
3
4description: updateOne-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_updateone_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
36tests:
37 -
38 description: 'UpdateOne with hint string'
39 operations:
40 -
41 object: *collection0
42 name: updateOne
43 arguments:
44 filter: &filter
45 _id:
46 $gt: 1
47 update: &update
48 $inc:
49 x: 1
50 hint: _id_
51 expectResult: &result
52 matchedCount: 1
53 modifiedCount: 1
54 upsertedCount: 0
55 expectEvents:
56 -
57 client: *client0
58 events:
59 -
60 commandStartedEvent:
61 command:
62 update: *collection_name
63 updates:
64 -
65 q: *filter
66 u: *update
67 hint: _id_
68 multi: { $$unsetOrMatches: false }
69 upsert: { $$unsetOrMatches: false }
70 outcome: &outcome
71 -
72 collectionName: *collection_name
73 databaseName: *database_name
74 documents:
75 -
76 _id: 1
77 x: 11
78 -
79 _id: 2
80 x: 23
81 -
82 description: 'UpdateOne with hint document'
83 operations:
84 -
85 object: *collection0
86 name: updateOne
87 arguments:
88 filter: *filter
89 update: *update
90 hint:
91 _id: 1
92 expectResult: *result
93 expectEvents:
94 -
95 client: *client0
96 events:
97 -
98 commandStartedEvent:
99 command:
100 update: *collection_name
101 updates:
102 -
103 q: *filter
104 u: *update
105 hint:
106 _id: 1
107 multi: { $$unsetOrMatches: false }
108 upsert: { $$unsetOrMatches: false }
109 outcome: *outcome
View as plain text