...
1description: "search index operations ignore read and write concern"
2schemaVersion: "1.4"
3createEntities:
4 - client:
5 id: &client0 client0
6 useMultipleMongoses: false
7 # Set a non-default read and write concern.
8 uriOptions:
9 readConcernLevel: local
10 w: 1
11 observeEvents:
12 - commandStartedEvent
13 - database:
14 id: &database0 database0
15 client: *client0
16 databaseName: *database0
17 - collection:
18 id: &collection0 collection0
19 database: *database0
20 collectionName: *collection0
21
22runOnRequirements:
23 - minServerVersion: "7.0.0"
24 topologies: [ replicaset, load-balanced, sharded ]
25 serverless: forbid
26
27tests:
28 - description: "createSearchIndex ignores read and write concern"
29 operations:
30 - name: createSearchIndex
31 object: *collection0
32 arguments:
33 model: { definition: &definition { mappings: { dynamic: true } } }
34 expectError:
35 # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
36 # that the driver constructs and sends the correct command.
37 # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
38 isError: true
39 errorContains: Atlas
40 expectEvents:
41 - client: *client0
42 events:
43 - commandStartedEvent:
44 command:
45 createSearchIndexes: *collection0
46 indexes: [ { definition: *definition } ]
47 $db: *database0
48 # Expect no writeConcern or readConcern to be sent.
49 writeConcern: { $$exists: false }
50 readConcern: { $$exists: false }
51
52 - description: "createSearchIndex ignores read and write concern"
53 operations:
54 - name: createSearchIndexes
55 object: *collection0
56 arguments:
57 models: []
58 expectError:
59 # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
60 # that the driver constructs and sends the correct command.
61 # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
62 isError: true
63 errorContains: Atlas
64 expectEvents:
65 - client: *client0
66 events:
67 - commandStartedEvent:
68 command:
69 createSearchIndexes: *collection0
70 indexes: []
71 $db: *database0
72 # Expect no writeConcern or readConcern to be sent.
73 writeConcern: { $$exists: false }
74 readConcern: { $$exists: false }
75
76 - description: "dropSearchIndex ignores read and write concern"
77 operations:
78 - name: dropSearchIndex
79 object: *collection0
80 arguments:
81 name: &indexName 'test index'
82 expectError:
83 # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
84 # that the driver constructs and sends the correct command.
85 # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
86 isError: true
87 errorContains: Atlas
88 expectEvents:
89 - client: *client0
90 events:
91 - commandStartedEvent:
92 command:
93 dropSearchIndex: *collection0
94 name: *indexName
95 $db: *database0
96 # Expect no writeConcern or readConcern to be sent.
97 writeConcern: { $$exists: false }
98 readConcern: { $$exists: false }
99
100 - description: "listSearchIndexes ignores read and write concern"
101 operations:
102 - name: listSearchIndexes
103 object: *collection0
104 expectError:
105 # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
106 # that the driver constructs and sends the correct command.
107 # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
108 isError: true
109 errorContains: Atlas
110 expectEvents:
111 - client: *client0
112 events:
113 - commandStartedEvent:
114 command:
115 aggregate: *collection0
116 pipeline:
117 - $listSearchIndexes: {}
118 # Expect no writeConcern or readConcern to be sent.
119 writeConcern: { $$exists: false }
120 readConcern: { $$exists: false }
121
122 - description: "updateSearchIndex ignores the read and write concern"
123 operations:
124 - name: updateSearchIndex
125 object: *collection0
126 arguments:
127 name: &indexName 'test index'
128 definition: &definition {}
129 expectError:
130 # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
131 # that the driver constructs and sends the correct command.
132 # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
133 isError: true
134 errorContains: Atlas
135 expectEvents:
136 - client: *client0
137 events:
138 - commandStartedEvent:
139 command:
140 updateSearchIndex: *collection0
141 name: *indexName
142 definition: *definition
143 $db: *database0
144 # Expect no writeConcern or readConcern to be sent.
145 writeConcern: { $$exists: false }
146 readConcern: { $$exists: false }
View as plain text