...
1# This file was created automatically using mongodb-spec-converter.
2# Please review the generated file, then remove this notice.
3
4description: findOneAndReplace-hint
5schemaVersion: '1.0'
6runOnRequirements:
7 -
8 minServerVersion: 4.3.1
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 findOneAndReplace_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: 'FindOneAndReplace with hint string'
39 operations:
40 -
41 object: *collection0
42 name: findOneAndReplace
43 arguments:
44 filter: &filter
45 _id: 1
46 replacement: &replacement
47 x: 33
48 hint: _id_
49 expectResult: &result
50 _id: 1
51 x: 11
52 expectEvents:
53 -
54 client: *client0
55 events:
56 -
57 commandStartedEvent:
58 command:
59 findAndModify: *collection_name
60 query: *filter
61 update: *replacement
62 hint: _id_
63 outcome: &outcome
64 -
65 collectionName: *collection_name
66 databaseName: *database_name
67 documents:
68 -
69 _id: 1
70 x: 33
71 -
72 _id: 2
73 x: 22
74 -
75 description: 'FindOneAndReplace with hint document'
76 operations:
77 -
78 object: *collection0
79 name: findOneAndReplace
80 arguments:
81 filter: *filter
82 replacement: *replacement
83 hint:
84 _id: 1
85 expectResult: *result
86 expectEvents:
87 -
88 client: *client0
89 events:
90 -
91 commandStartedEvent:
92 command:
93 findAndModify: *collection_name
94 query: *filter
95 update: *replacement
96 hint:
97 _id: 1
98 outcome: *outcome
View as plain text