mongo 2.19.2 → 2.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/Rakefile +27 -154
  4. data/lib/mongo/cluster/topology/base.rb +16 -0
  5. data/lib/mongo/cluster.rb +27 -1
  6. data/lib/mongo/collection/view/iterable.rb +1 -0
  7. data/lib/mongo/collection.rb +27 -3
  8. data/lib/mongo/error/transactions_not_supported.rb +34 -0
  9. data/lib/mongo/error.rb +1 -0
  10. data/lib/mongo/grid/fs_bucket.rb +6 -0
  11. data/lib/mongo/monitoring/event/secure.rb +1 -1
  12. data/lib/mongo/operation/create_search_indexes/op_msg.rb +31 -0
  13. data/lib/mongo/operation/create_search_indexes.rb +15 -0
  14. data/lib/mongo/operation/drop_search_index/op_msg.rb +33 -0
  15. data/lib/mongo/operation/drop_search_index.rb +15 -0
  16. data/lib/mongo/operation/shared/executable.rb +43 -27
  17. data/lib/mongo/operation/shared/response_handling.rb +23 -25
  18. data/lib/mongo/operation/shared/specifiable.rb +7 -0
  19. data/lib/mongo/operation/update_search_index/op_msg.rb +34 -0
  20. data/lib/mongo/operation/update_search_index.rb +15 -0
  21. data/lib/mongo/operation.rb +3 -0
  22. data/lib/mongo/retryable/read_worker.rb +7 -6
  23. data/lib/mongo/retryable/write_worker.rb +7 -4
  24. data/lib/mongo/retryable.rb +2 -2
  25. data/lib/mongo/search_index/view.rb +232 -0
  26. data/lib/mongo/server/app_metadata/environment.rb +64 -9
  27. data/lib/mongo/server/app_metadata.rb +5 -4
  28. data/lib/mongo/server/description/features.rb +1 -0
  29. data/lib/mongo/server_selector/base.rb +32 -6
  30. data/lib/mongo/session/server_session/dirtyable.rb +52 -0
  31. data/lib/mongo/session/server_session.rb +3 -0
  32. data/lib/mongo/session/session_pool.rb +12 -18
  33. data/lib/mongo/session.rb +32 -0
  34. data/lib/mongo/uri.rb +0 -4
  35. data/lib/mongo/version.rb +1 -1
  36. data/lib/mongo.rb +1 -0
  37. data/mongo.gemspec +1 -7
  38. data/spec/atlas/atlas_connectivity_spec.rb +5 -9
  39. data/spec/atlas/operations_spec.rb +1 -5
  40. data/spec/faas/ruby-sam-app/Gemfile +9 -0
  41. data/spec/faas/ruby-sam-app/mongodb/Gemfile +4 -0
  42. data/spec/faas/ruby-sam-app/mongodb/app.rb +149 -0
  43. data/spec/faas/ruby-sam-app/template.yaml +48 -0
  44. data/spec/integration/client_side_encryption/corpus_spec.rb +10 -2
  45. data/spec/integration/retryable_reads_errors_spec.rb +161 -8
  46. data/spec/integration/retryable_writes_errors_spec.rb +156 -0
  47. data/spec/integration/search_indexes_prose_spec.rb +168 -0
  48. data/spec/lite_spec_helper.rb +32 -10
  49. data/spec/mongo/cluster_spec.rb +36 -0
  50. data/spec/mongo/collection/view/aggregation_spec.rb +6 -1
  51. data/spec/mongo/collection/view/explainable_spec.rb +2 -0
  52. data/spec/mongo/collection_crud_spec.rb +1 -1
  53. data/spec/mongo/operation/insert_spec.rb +1 -1
  54. data/spec/mongo/retryable/write_worker_spec.rb +39 -0
  55. data/spec/mongo/server/app_metadata/environment_spec.rb +135 -0
  56. data/spec/mongo/server/app_metadata_spec.rb +12 -2
  57. data/spec/mongo/server/connection_spec.rb +4 -0
  58. data/spec/mongo/session/session_pool_spec.rb +1 -16
  59. data/spec/mongo/session_transaction_spec.rb +15 -0
  60. data/spec/mongo/uri_spec.rb +0 -9
  61. data/spec/runners/crud/test.rb +0 -8
  62. data/spec/runners/crud.rb +1 -1
  63. data/spec/runners/transactions/test.rb +12 -3
  64. data/spec/runners/unified/assertions.rb +16 -3
  65. data/spec/runners/unified/crud_operations.rb +12 -0
  66. data/spec/runners/unified/search_index_operations.rb +63 -0
  67. data/spec/runners/unified/support_operations.rb +3 -5
  68. data/spec/runners/unified/test.rb +11 -2
  69. data/spec/shared/lib/mrss/docker_runner.rb +3 -0
  70. data/spec/shared/share/Dockerfile.erb +20 -69
  71. data/spec/shared/shlib/server.sh +1 -0
  72. data/spec/shared/shlib/set_env.sh +5 -28
  73. data/spec/spec_helper.rb +1 -1
  74. data/spec/spec_tests/data/client_side_encryption/explain.yml +2 -2
  75. data/spec/spec_tests/data/connection_string/invalid-uris.yml +0 -10
  76. data/spec/spec_tests/data/connection_string/valid-options.yml +13 -0
  77. data/spec/spec_tests/data/crud_unified/find-test-all-options.yml +348 -0
  78. data/spec/spec_tests/data/index_management/createSearchIndex.yml +64 -0
  79. data/spec/spec_tests/data/index_management/createSearchIndexes.yml +86 -0
  80. data/spec/spec_tests/data/index_management/dropSearchIndex.yml +43 -0
  81. data/spec/spec_tests/data/index_management/listSearchIndexes.yml +91 -0
  82. data/spec/spec_tests/data/index_management/updateSearchIndex.yml +46 -0
  83. data/spec/spec_tests/data/retryable_writes/unified/bulkWrite-serverErrors.yml +3 -6
  84. data/spec/spec_tests/data/retryable_writes/unified/insertOne-serverErrors.yml +3 -6
  85. data/spec/spec_tests/data/run_command_unified/runCommand.yml +319 -0
  86. data/spec/spec_tests/data/sessions_unified/driver-sessions-dirty-session-errors.yml +351 -0
  87. data/spec/spec_tests/data/unified/valid-pass/poc-crud.yml +1 -1
  88. data/spec/spec_tests/data/unified/valid-pass/poc-retryable-writes.yml +7 -7
  89. data/spec/spec_tests/data/unified/valid-pass/poc-sessions.yml +3 -4
  90. data/spec/spec_tests/data/unified/valid-pass/poc-transactions-convenient-api.yml +1 -1
  91. data/spec/spec_tests/data/unified/valid-pass/poc-transactions-mongos-pin-auto.yml +1 -1
  92. data/spec/spec_tests/data/unified/valid-pass/poc-transactions.yml +3 -3
  93. data/spec/spec_tests/index_management_unified_spec.rb +13 -0
  94. data/spec/spec_tests/run_command_unified_spec.rb +13 -0
  95. data/spec/spec_tests/sdam_unified_spec.rb +2 -0
  96. data/spec/support/constraints.rb +6 -0
  97. data/spec/support/faas/app/aws_lambda/mongodb/Gemfile.lock +19 -0
  98. data/spec/support/ocsp +1 -1
  99. data/spec/support/recording_logger.rb +27 -0
  100. data/spec/support/spec_config.rb +5 -0
  101. data.tar.gz.sig +0 -0
  102. metadata +1329 -1285
  103. metadata.gz.sig +3 -2
  104. data/spec/spec_tests/data/cmap/pool-clear-interrupt-immediately.yml +0 -49
@@ -15,3 +15,16 @@ tests:
15
15
  db: "admin"
16
16
  options:
17
17
  authmechanism: "MONGODB-CR"
18
+ -
19
+ description: "Missing delimiting slash between hosts and options"
20
+ uri: "mongodb://example.com?tls=true"
21
+ valid: true
22
+ warning: false
23
+ hosts:
24
+ -
25
+ type: "hostname"
26
+ host: "example.com"
27
+ port: ~
28
+ auth: ~
29
+ options:
30
+ tls: true
@@ -0,0 +1,348 @@
1
+ description: "find options"
2
+
3
+ schemaVersion: "1.0"
4
+ runOnRequirements:
5
+ - serverless: 'forbid'
6
+
7
+
8
+ createEntities:
9
+ - client:
10
+ id: &client0 client0
11
+ observeEvents: [ commandStartedEvent ]
12
+ - database:
13
+ id: &database0 database0
14
+ client: *client0
15
+ databaseName: &database0Name find-tests
16
+ - collection:
17
+ id: &collection0 collection0
18
+ database: *database0
19
+ collectionName: &collection0Name coll0
20
+
21
+ tests:
22
+ - description: "sort"
23
+ operations:
24
+ - name: find
25
+ arguments:
26
+ filter: &filter { _name: "John" }
27
+ sort: &sort { _id: 1 }
28
+ object: *collection0
29
+ expectEvents:
30
+ - client: *client0
31
+ events:
32
+ - commandStartedEvent:
33
+ command:
34
+ find: *collection0Name
35
+ filter: *filter
36
+ sort: *sort
37
+ commandName: find
38
+
39
+ - description: "projection"
40
+ operations:
41
+ - name: find
42
+ arguments:
43
+ filter: *filter
44
+ projection: &projection { _id: 1 }
45
+ object: *collection0
46
+ expectEvents:
47
+ - client: *client0
48
+ events:
49
+ - commandStartedEvent:
50
+ command:
51
+ find: *collection0Name
52
+ filter: *filter
53
+ projection: *projection
54
+ commandName: find
55
+ databaseName: *database0Name
56
+
57
+ - description: "hint"
58
+ operations:
59
+ - name: find
60
+ arguments:
61
+ filter: *filter
62
+ hint: &hint { _id: 1 }
63
+ object: *collection0
64
+ expectEvents:
65
+ - client: *client0
66
+ events:
67
+ - commandStartedEvent:
68
+ command:
69
+ find: *collection0Name
70
+ filter: *filter
71
+ hint: *hint
72
+ commandName: find
73
+ databaseName: *database0Name
74
+
75
+ - description: "skip"
76
+ operations:
77
+ - name: find
78
+ arguments:
79
+ filter: *filter
80
+ skip: &skip 10
81
+ object: *collection0
82
+ expectEvents:
83
+ - client: *client0
84
+ events:
85
+ - commandStartedEvent:
86
+ command:
87
+ find: *collection0Name
88
+ filter: *filter
89
+ skip: *skip
90
+ commandName: find
91
+ databaseName: *database0Name
92
+
93
+ - description: "limit"
94
+ operations:
95
+ - name: find
96
+ arguments:
97
+ filter: *filter
98
+ limit: &limit 10
99
+ object: *collection0
100
+ expectEvents:
101
+ - client: *client0
102
+ events:
103
+ - commandStartedEvent:
104
+ command:
105
+ find: *collection0Name
106
+ filter: *filter
107
+ limit: *limit
108
+ commandName: find
109
+ databaseName: *database0Name
110
+
111
+ - description: "batchSize"
112
+ operations:
113
+ - name: find
114
+ arguments:
115
+ filter: *filter
116
+ batchSize: &batchSize 10
117
+ object: *collection0
118
+ expectEvents:
119
+ - client: *client0
120
+ events:
121
+ - commandStartedEvent:
122
+ command:
123
+ find: *collection0Name
124
+ filter: *filter
125
+ batchSize: *batchSize
126
+ commandName: find
127
+ databaseName: *database0Name
128
+
129
+ - description: "comment"
130
+ operations:
131
+ - name: find
132
+ arguments:
133
+ filter: *filter
134
+ comment: &comment 'comment'
135
+ object: *collection0
136
+ expectEvents:
137
+ - client: *client0
138
+ events:
139
+ - commandStartedEvent:
140
+ command:
141
+ find: *collection0Name
142
+ filter: *filter
143
+ comment: *comment
144
+ commandName: find
145
+ databaseName: *database0Name
146
+
147
+ - description: "maxTimeMS"
148
+ operations:
149
+ - name: find
150
+ arguments:
151
+ filter: *filter
152
+ maxTimeMS: &maxTimeMS 1000
153
+ object: *collection0
154
+ expectEvents:
155
+ - client: *client0
156
+ events:
157
+ - commandStartedEvent:
158
+ command:
159
+ find: *collection0Name
160
+ filter: *filter
161
+ maxTimeMS: *maxTimeMS
162
+ commandName: find
163
+ databaseName: *database0Name
164
+
165
+ - description: "max"
166
+ operations:
167
+ - name: find
168
+ arguments:
169
+ filter: *filter
170
+ max: &max { _id: 10 }
171
+ object: *collection0
172
+ expectEvents:
173
+ - client: *client0
174
+ events:
175
+ - commandStartedEvent:
176
+ command:
177
+ find: *collection0Name
178
+ filter: *filter
179
+ max: *max
180
+ commandName: find
181
+ databaseName: *database0Name
182
+
183
+ - description: "min"
184
+ operations:
185
+ - name: find
186
+ arguments:
187
+ filter: *filter
188
+ hint: { name: 1 }
189
+ min: &min { name: 'John' }
190
+ object: *collection0
191
+ expectEvents:
192
+ - client: *client0
193
+ events:
194
+ - commandStartedEvent:
195
+ command:
196
+ find: *collection0Name
197
+ filter: *filter
198
+ min: *min
199
+ commandName: find
200
+ databaseName: *database0Name
201
+
202
+ - description: "returnKey"
203
+ operations:
204
+ - name: find
205
+ arguments:
206
+ filter: *filter
207
+ returnKey: &returnKey false
208
+ object: *collection0
209
+ expectEvents:
210
+ - client: *client0
211
+ events:
212
+ - commandStartedEvent:
213
+ command:
214
+ find: *collection0Name
215
+ filter: *filter
216
+ returnKey: *returnKey
217
+ commandName: find
218
+ databaseName: *database0Name
219
+
220
+ - description: "showRecordId"
221
+ operations:
222
+ - name: find
223
+ arguments:
224
+ filter: *filter
225
+ showRecordId: &showRecordId false
226
+ object: *collection0
227
+ expectEvents:
228
+ - client: *client0
229
+ events:
230
+ - commandStartedEvent:
231
+ command:
232
+ find: *collection0Name
233
+ filter: *filter
234
+ showRecordId: *showRecordId
235
+ commandName: find
236
+ databaseName: *database0Name
237
+
238
+ - description: "oplogReplay"
239
+ operations:
240
+ - name: find
241
+ arguments:
242
+ filter: *filter
243
+ oplogReplay: &oplogReplay false
244
+ object: *collection0
245
+ expectEvents:
246
+ - client: *client0
247
+ events:
248
+ - commandStartedEvent:
249
+ command:
250
+ find: *collection0Name
251
+ filter: *filter
252
+ oplogReplay: *oplogReplay
253
+ commandName: find
254
+ databaseName: *database0Name
255
+
256
+ - description: "noCursorTimeout"
257
+ operations:
258
+ - name: find
259
+ arguments:
260
+ filter: *filter
261
+ noCursorTimeout: &noCursorTimeout false
262
+ object: *collection0
263
+ expectEvents:
264
+ - client: *client0
265
+ events:
266
+ - commandStartedEvent:
267
+ command:
268
+ find: *collection0Name
269
+ filter: *filter
270
+ noCursorTimeout: *noCursorTimeout
271
+ commandName: find
272
+ databaseName: *database0Name
273
+
274
+ - description: "allowPartialResults"
275
+ operations:
276
+ - name: find
277
+ arguments:
278
+ filter: *filter
279
+ allowPartialResults: &allowPartialResults false
280
+ object: *collection0
281
+ expectEvents:
282
+ - client: *client0
283
+ events:
284
+ - commandStartedEvent:
285
+ command:
286
+ find: *collection0Name
287
+ filter: *filter
288
+ allowPartialResults: *allowPartialResults
289
+ commandName: find
290
+ databaseName: *database0Name
291
+
292
+ - description: "collation"
293
+ operations:
294
+ - name: find
295
+ arguments:
296
+ filter: *filter
297
+ collation: &collation { locale: "en" }
298
+ object: *collection0
299
+ expectEvents:
300
+ - client: *client0
301
+ events:
302
+ - commandStartedEvent:
303
+ command:
304
+ find: *collection0Name
305
+ filter: *filter
306
+ collation: *collation
307
+ commandName: find
308
+ databaseName: *database0Name
309
+
310
+ - description: "allowDiskUse"
311
+ runOnRequirements:
312
+ - minServerVersion: 4.4
313
+ operations:
314
+ - name: find
315
+ arguments:
316
+ filter: *filter
317
+ allowDiskUse: &allowDiskUse true
318
+ object: *collection0
319
+ expectEvents:
320
+ - client: *client0
321
+ events:
322
+ - commandStartedEvent:
323
+ command:
324
+ find: *collection0Name
325
+ filter: *filter
326
+ allowDiskUse: *allowDiskUse
327
+ commandName: find
328
+ databaseName: *database0Name
329
+
330
+ - description: "let"
331
+ runOnRequirements:
332
+ - minServerVersion: "5.0"
333
+ operations:
334
+ - name: find
335
+ arguments:
336
+ filter: *filter
337
+ let: &let { name: "Mary" }
338
+ object: *collection0
339
+ expectEvents:
340
+ - client: *client0
341
+ events:
342
+ - commandStartedEvent:
343
+ command:
344
+ find: *collection0Name
345
+ filter: *filter
346
+ let: *let
347
+ commandName: find
348
+ databaseName: *database0Name
@@ -0,0 +1,64 @@
1
+ description: "createSearchIndex"
2
+ schemaVersion: "1.4"
3
+ createEntities:
4
+ - client:
5
+ id: &client0 client0
6
+ useMultipleMongoses: false
7
+ observeEvents:
8
+ - commandStartedEvent
9
+ - database:
10
+ id: &database0 database0
11
+ client: *client0
12
+ databaseName: *database0
13
+ - collection:
14
+ id: &collection0 collection0
15
+ database: *database0
16
+ collectionName: *collection0
17
+
18
+ runOnRequirements:
19
+ - minServerVersion: "7.0.0"
20
+ topologies: [ replicaset, load-balanced, sharded ]
21
+ serverless: forbid
22
+
23
+ tests:
24
+ - description: "no name provided for an index definition"
25
+ operations:
26
+ - name: createSearchIndex
27
+ object: *collection0
28
+ arguments:
29
+ model: { definition: &definition { mappings: { dynamic: true } } }
30
+ expectError:
31
+ # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
32
+ # that the driver constructs and sends the correct command.
33
+ # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
34
+ isError: true
35
+ errorContains: Atlas
36
+ expectEvents:
37
+ - client: *client0
38
+ events:
39
+ - commandStartedEvent:
40
+ command:
41
+ createSearchIndexes: *collection0
42
+ indexes: [ { definition: *definition } ]
43
+ $db: *database0
44
+
45
+ - description: "name provided for an index definition"
46
+ operations:
47
+ - name: createSearchIndex
48
+ object: *collection0
49
+ arguments:
50
+ model: { definition: &definition { mappings: { dynamic: true } } , name: 'test index' }
51
+ expectError:
52
+ # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
53
+ # that the driver constructs and sends the correct command.
54
+ # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
55
+ isError: true
56
+ errorContains: Atlas
57
+ expectEvents:
58
+ - client: *client0
59
+ events:
60
+ - commandStartedEvent:
61
+ command:
62
+ createSearchIndexes: *collection0
63
+ indexes: [ { definition: *definition, name: 'test index' } ]
64
+ $db: *database0
@@ -0,0 +1,86 @@
1
+ description: "createSearchIndexes"
2
+ schemaVersion: "1.4"
3
+ createEntities:
4
+ - client:
5
+ id: &client0 client0
6
+ useMultipleMongoses: false
7
+ observeEvents:
8
+ - commandStartedEvent
9
+ - database:
10
+ id: &database0 database0
11
+ client: *client0
12
+ databaseName: *database0
13
+ - collection:
14
+ id: &collection0 collection0
15
+ database: *database0
16
+ collectionName: *collection0
17
+
18
+ runOnRequirements:
19
+ - minServerVersion: "7.0.0"
20
+ topologies: [ replicaset, load-balanced, sharded ]
21
+ serverless: forbid
22
+
23
+ tests:
24
+ - description: "empty index definition array"
25
+ operations:
26
+ - name: createSearchIndexes
27
+ object: *collection0
28
+ arguments:
29
+ models: []
30
+ expectError:
31
+ # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
32
+ # that the driver constructs and sends the correct command.
33
+ # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
34
+ isError: true
35
+ errorContains: Atlas
36
+ expectEvents:
37
+ - client: *client0
38
+ events:
39
+ - commandStartedEvent:
40
+ command:
41
+ createSearchIndexes: *collection0
42
+ indexes: []
43
+ $db: *database0
44
+
45
+
46
+ - description: "no name provided for an index definition"
47
+ operations:
48
+ - name: createSearchIndexes
49
+ object: *collection0
50
+ arguments:
51
+ models: [ { definition: &definition { mappings: { dynamic: true } } } ]
52
+ expectError:
53
+ # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
54
+ # that the driver constructs and sends the correct command.
55
+ # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
56
+ isError: true
57
+ errorContains: Atlas
58
+ expectEvents:
59
+ - client: *client0
60
+ events:
61
+ - commandStartedEvent:
62
+ command:
63
+ createSearchIndexes: *collection0
64
+ indexes: [ { definition: *definition } ]
65
+ $db: *database0
66
+
67
+ - description: "name provided for an index definition"
68
+ operations:
69
+ - name: createSearchIndexes
70
+ object: *collection0
71
+ arguments:
72
+ models: [ { definition: &definition { mappings: { dynamic: true } } , name: 'test index' } ]
73
+ expectError:
74
+ # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
75
+ # that the driver constructs and sends the correct command.
76
+ # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
77
+ isError: true
78
+ errorContains: Atlas
79
+ expectEvents:
80
+ - client: *client0
81
+ events:
82
+ - commandStartedEvent:
83
+ command:
84
+ createSearchIndexes: *collection0
85
+ indexes: [ { definition: *definition, name: 'test index' } ]
86
+ $db: *database0
@@ -0,0 +1,43 @@
1
+ description: "dropSearchIndex"
2
+ schemaVersion: "1.4"
3
+ createEntities:
4
+ - client:
5
+ id: &client0 client0
6
+ useMultipleMongoses: false
7
+ observeEvents:
8
+ - commandStartedEvent
9
+ - database:
10
+ id: &database0 database0
11
+ client: *client0
12
+ databaseName: *database0
13
+ - collection:
14
+ id: &collection0 collection0
15
+ database: *database0
16
+ collectionName: *collection0
17
+
18
+ runOnRequirements:
19
+ - minServerVersion: "7.0.0"
20
+ topologies: [ replicaset, load-balanced, sharded ]
21
+ serverless: forbid
22
+
23
+ tests:
24
+ - description: "sends the correct command"
25
+ operations:
26
+ - name: dropSearchIndex
27
+ object: *collection0
28
+ arguments:
29
+ name: &indexName 'test index'
30
+ expectError:
31
+ # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
32
+ # that the driver constructs and sends the correct command.
33
+ # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
34
+ isError: true
35
+ errorContains: Atlas
36
+ expectEvents:
37
+ - client: *client0
38
+ events:
39
+ - commandStartedEvent:
40
+ command:
41
+ dropSearchIndex: *collection0
42
+ name: *indexName
43
+ $db: *database0
@@ -0,0 +1,91 @@
1
+ description: "listSearchIndexes"
2
+ schemaVersion: "1.4"
3
+ createEntities:
4
+ - client:
5
+ id: &client0 client0
6
+ useMultipleMongoses: false
7
+ observeEvents:
8
+ - commandStartedEvent
9
+ - database:
10
+ id: &database0 database0
11
+ client: *client0
12
+ databaseName: *database0
13
+ - collection:
14
+ id: &collection0 collection0
15
+ database: *database0
16
+ collectionName: *collection0
17
+
18
+ runOnRequirements:
19
+ - minServerVersion: "7.0.0"
20
+ topologies: [ replicaset, load-balanced, sharded ]
21
+ serverless: forbid
22
+
23
+ tests:
24
+ - description: "when no name is provided, it does not populate the filter"
25
+ skipReason: https://jira.mongodb.org/browse/DRIVERS-2794
26
+ operations:
27
+ - name: listSearchIndexes
28
+ object: *collection0
29
+ expectError:
30
+ # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
31
+ # that the driver constructs and sends the correct command.
32
+ # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
33
+ isError: true
34
+ errorContains: Atlas
35
+ expectEvents:
36
+ - client: *client0
37
+ events:
38
+ - commandStartedEvent:
39
+ command:
40
+ aggregate: *collection0
41
+ pipeline:
42
+ - $listSearchIndexes: {}
43
+
44
+ - description: "when a name is provided, it is present in the filter"
45
+ skipReason: https://jira.mongodb.org/browse/DRIVERS-2794
46
+ operations:
47
+ - name: listSearchIndexes
48
+ object: *collection0
49
+ arguments:
50
+ name: &indexName "test index"
51
+ expectError:
52
+ # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
53
+ # that the driver constructs and sends the correct command.
54
+ # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
55
+ isError: true
56
+ errorContains: Atlas
57
+ expectEvents:
58
+ - client: *client0
59
+ events:
60
+ - commandStartedEvent:
61
+ command:
62
+ aggregate: *collection0
63
+ pipeline:
64
+ - $listSearchIndexes: { name: *indexName }
65
+ $db: *database0
66
+
67
+ - description: aggregation cursor options are supported
68
+ skipReason: https://jira.mongodb.org/browse/DRIVERS-2794
69
+ operations:
70
+ - name: listSearchIndexes
71
+ object: *collection0
72
+ arguments:
73
+ name: &indexName "test index"
74
+ aggregationOptions:
75
+ batchSize: 10
76
+ expectError:
77
+ # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
78
+ # that the driver constructs and sends the correct command.
79
+ # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
80
+ isError: true
81
+ errorContains: Atlas
82
+ expectEvents:
83
+ - client: *client0
84
+ events:
85
+ - commandStartedEvent:
86
+ command:
87
+ aggregate: *collection0
88
+ cursor: { batchSize: 10 }
89
+ pipeline:
90
+ - $listSearchIndexes: { name: *indexName }
91
+ $db: *database0
@@ -0,0 +1,46 @@
1
+ description: "updateSearchIndex"
2
+ schemaVersion: "1.4"
3
+ createEntities:
4
+ - client:
5
+ id: &client0 client0
6
+ useMultipleMongoses: false
7
+ observeEvents:
8
+ - commandStartedEvent
9
+ - database:
10
+ id: &database0 database0
11
+ client: *client0
12
+ databaseName: *database0
13
+ - collection:
14
+ id: &collection0 collection0
15
+ database: *database0
16
+ collectionName: *collection0
17
+
18
+ runOnRequirements:
19
+ - minServerVersion: "7.0.0"
20
+ topologies: [ replicaset, load-balanced, sharded ]
21
+ serverless: forbid
22
+
23
+ tests:
24
+ - description: "sends the correct command"
25
+ operations:
26
+ - name: updateSearchIndex
27
+ object: *collection0
28
+ arguments:
29
+ name: &indexName 'test index'
30
+ definition: &definition {}
31
+ expectError:
32
+ # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
33
+ # that the driver constructs and sends the correct command.
34
+ # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
35
+ isError: true
36
+ errorContains: Atlas
37
+ expectEvents:
38
+ - client: *client0
39
+ events:
40
+ - commandStartedEvent:
41
+ command:
42
+ updateSearchIndex: *collection0
43
+ name: *indexName
44
+ definition: *definition
45
+ $db: *database0
46
+