mongo 2.19.1 → 2.19.3

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 (35) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/lib/mongo/collection/view/iterable.rb +15 -0
  4. data/lib/mongo/collection/view.rb +1 -0
  5. data/lib/mongo/collection.rb +23 -1
  6. data/lib/mongo/operation/create_search_indexes/op_msg.rb +31 -0
  7. data/lib/mongo/operation/create_search_indexes.rb +15 -0
  8. data/lib/mongo/operation/drop_search_index/op_msg.rb +33 -0
  9. data/lib/mongo/operation/drop_search_index.rb +15 -0
  10. data/lib/mongo/operation/shared/specifiable.rb +7 -0
  11. data/lib/mongo/operation/update_search_index/op_msg.rb +34 -0
  12. data/lib/mongo/operation/update_search_index.rb +15 -0
  13. data/lib/mongo/operation.rb +3 -0
  14. data/lib/mongo/search_index/view.rb +232 -0
  15. data/lib/mongo/version.rb +1 -1
  16. data/lib/mongo.rb +1 -0
  17. data/spec/atlas/atlas_connectivity_spec.rb +1 -5
  18. data/spec/atlas/operations_spec.rb +1 -5
  19. data/spec/integration/find_options_spec.rb +227 -0
  20. data/spec/integration/search_indexes_prose_spec.rb +168 -0
  21. data/spec/lite_spec_helper.rb +32 -10
  22. data/spec/runners/unified/search_index_operations.rb +63 -0
  23. data/spec/runners/unified/test.rb +3 -1
  24. data/spec/spec_helper.rb +1 -1
  25. data/spec/spec_tests/data/index_management/createSearchIndex.yml +62 -0
  26. data/spec/spec_tests/data/index_management/createSearchIndexes.yml +83 -0
  27. data/spec/spec_tests/data/index_management/dropSearchIndex.yml +42 -0
  28. data/spec/spec_tests/data/index_management/listSearchIndexes.yml +85 -0
  29. data/spec/spec_tests/data/index_management/updateSearchIndex.yml +45 -0
  30. data/spec/spec_tests/index_management_unified_spec.rb +13 -0
  31. data/spec/support/faas/app/aws_lambda/mongodb/Gemfile.lock +19 -0
  32. data/spec/support/spec_config.rb +5 -0
  33. data.tar.gz.sig +0 -0
  34. metadata +1277 -1250
  35. metadata.gz.sig +0 -0
@@ -0,0 +1,42 @@
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
+ isError: true
34
+ errorContains: Search index commands are only supported with Atlas
35
+ expectEvents:
36
+ - client: *client0
37
+ events:
38
+ - commandStartedEvent:
39
+ command:
40
+ dropSearchIndex: *collection0
41
+ name: *indexName
42
+ $db: *database0
@@ -0,0 +1,85 @@
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
+ operations:
26
+ - name: listSearchIndexes
27
+ object: *collection0
28
+ expectError:
29
+ # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
30
+ # that the driver constructs and sends the correct command.
31
+ isError: true
32
+ errorContains: Search index commands are only supported with Atlas
33
+ expectEvents:
34
+ - client: *client0
35
+ events:
36
+ - commandStartedEvent:
37
+ command:
38
+ aggregate: *collection0
39
+ pipeline:
40
+ - $listSearchIndexes: {}
41
+
42
+ - description: "when a name is provided, it is present in the filter"
43
+ operations:
44
+ - name: listSearchIndexes
45
+ object: *collection0
46
+ arguments:
47
+ name: &indexName "test index"
48
+ expectError:
49
+ # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
50
+ # that the driver constructs and sends the correct command.
51
+ isError: true
52
+ errorContains: Search index commands are only supported with Atlas
53
+ expectEvents:
54
+ - client: *client0
55
+ events:
56
+ - commandStartedEvent:
57
+ command:
58
+ aggregate: *collection0
59
+ pipeline:
60
+ - $listSearchIndexes: { name: *indexName }
61
+ $db: *database0
62
+
63
+ - description: aggregation cursor options are supported
64
+ operations:
65
+ - name: listSearchIndexes
66
+ object: *collection0
67
+ arguments:
68
+ name: &indexName "test index"
69
+ aggregationOptions:
70
+ batchSize: 10
71
+ expectError:
72
+ # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
73
+ # that the driver constructs and sends the correct command.
74
+ isError: true
75
+ errorContains: Search index commands are only supported with Atlas
76
+ expectEvents:
77
+ - client: *client0
78
+ events:
79
+ - commandStartedEvent:
80
+ command:
81
+ aggregate: *collection0
82
+ cursor: { batchSize: 10 }
83
+ pipeline:
84
+ - $listSearchIndexes: { name: *indexName }
85
+ $db: *database0
@@ -0,0 +1,45 @@
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
+ isError: true
35
+ errorContains: Search index commands are only supported with Atlas
36
+ expectEvents:
37
+ - client: *client0
38
+ events:
39
+ - commandStartedEvent:
40
+ command:
41
+ updateSearchIndex: *collection0
42
+ name: *indexName
43
+ definition: *definition
44
+ $db: *database0
45
+
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+ require 'runners/unified'
5
+
6
+ base = "#{CURRENT_PATH}/spec_tests/data/index_management"
7
+ INDEX_MANAGEMENT_UNIFIED_TESTS = Dir.glob("#{base}/**/*.yml").sort
8
+
9
+ # rubocop:disable RSpec/EmptyExampleGroup
10
+ describe 'index management unified spec tests' do
11
+ define_unified_spec_tests(base, INDEX_MANAGEMENT_UNIFIED_TESTS)
12
+ end
13
+ # rubocop:enable RSpec/EmptyExampleGroup
@@ -0,0 +1,19 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ bson (4.15.0)
5
+ mongo (2.19.1)
6
+ bson (>= 4.14.1, < 5.0.0)
7
+
8
+ PLATFORMS
9
+ arm64-darwin-22
10
+ x86_64-linux
11
+
12
+ DEPENDENCIES
13
+ mongo
14
+
15
+ RUBY VERSION
16
+ ruby 3.2.2p53
17
+
18
+ BUNDLED WITH
19
+ 2.4.12
@@ -172,6 +172,11 @@ class SpecConfig
172
172
  !!ENV['SERVERLESS']
173
173
  end
174
174
 
175
+ def kill_all_server_sessions?
176
+ !serverless? && # Serverless instances do not support killAllSessions command.
177
+ ClusterConfig.instance.fcv_ish >= '3.6'
178
+ end
179
+
175
180
  # Test suite configuration
176
181
 
177
182
  def client_debug?
data.tar.gz.sig CHANGED
Binary file