mongo 2.18.0.beta1 → 2.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/lib/mongo/bulk_write.rb +8 -2
  4. data/lib/mongo/client.rb +19 -5
  5. data/lib/mongo/client_encryption.rb +86 -4
  6. data/lib/mongo/cluster.rb +6 -4
  7. data/lib/mongo/collection/view/aggregation.rb +3 -0
  8. data/lib/mongo/collection/view/change_stream.rb +9 -0
  9. data/lib/mongo/collection/view/iterable.rb +1 -0
  10. data/lib/mongo/collection/view/readable.rb +11 -3
  11. data/lib/mongo/collection.rb +9 -1
  12. data/lib/mongo/config.rb +11 -0
  13. data/lib/mongo/crypt/auto_encrypter.rb +49 -21
  14. data/lib/mongo/crypt/binding.rb +73 -48
  15. data/lib/mongo/crypt/data_key_context.rb +6 -1
  16. data/lib/mongo/crypt/encryption_io.rb +66 -0
  17. data/lib/mongo/crypt/explicit_encrypter.rb +116 -5
  18. data/lib/mongo/crypt/explicit_encryption_context.rb +3 -8
  19. data/lib/mongo/crypt/handle.rb +26 -8
  20. data/lib/mongo/crypt/kms/aws.rb +11 -3
  21. data/lib/mongo/crypt/kms/azure.rb +14 -6
  22. data/lib/mongo/crypt/kms/gcp.rb +12 -5
  23. data/lib/mongo/crypt/kms/kmip.rb +15 -9
  24. data/lib/mongo/crypt/kms/local.rb +9 -1
  25. data/lib/mongo/crypt/kms/master_key_document.rb +1 -1
  26. data/lib/mongo/crypt/rewrap_many_data_key_context.rb +46 -0
  27. data/lib/mongo/crypt/rewrap_many_data_key_result.rb +37 -0
  28. data/lib/mongo/crypt/status.rb +8 -2
  29. data/lib/mongo/crypt.rb +2 -0
  30. data/lib/mongo/database.rb +10 -27
  31. data/lib/mongo/error/missing_file_chunk.rb +8 -2
  32. data/lib/mongo/grid/stream/read.rb +6 -0
  33. data/lib/mongo/index/view.rb +1 -0
  34. data/lib/mongo/operation/create/op_msg.rb +1 -13
  35. data/lib/mongo/operation/distinct/op_msg.rb +4 -1
  36. data/lib/mongo/protocol/msg.rb +0 -16
  37. data/lib/mongo/server/connection_pool.rb +5 -4
  38. data/lib/mongo/server/monitor/connection.rb +10 -4
  39. data/lib/mongo/server/monitor.rb +4 -0
  40. data/lib/mongo/server/push_monitor.rb +4 -0
  41. data/lib/mongo/version.rb +1 -1
  42. data/lib/mongo.rb +2 -0
  43. data/spec/README.md +14 -0
  44. data/spec/integration/change_stream_spec.rb +1 -1
  45. data/spec/integration/client_construction_spec.rb +73 -7
  46. data/spec/integration/client_side_encryption/auto_encryption_command_monitoring_spec.rb +165 -164
  47. data/spec/integration/client_side_encryption/decryption_events_prose_spec.rb +158 -0
  48. data/spec/integration/client_side_encryption/explicit_queryable_encryption_spec.rb +5 -5
  49. data/spec/integration/client_side_encryption/kms_tls_options_spec.rb +50 -8
  50. data/spec/integration/client_side_encryption/unique_index_on_key_alt_names_prose_spec.rb +85 -0
  51. data/spec/integration/ocsp_verifier_spec.rb +1 -1
  52. data/spec/integration/reconnect_spec.rb +2 -0
  53. data/spec/integration/sdam_events_spec.rb +40 -0
  54. data/spec/integration/srv_monitoring_spec.rb +1 -0
  55. data/spec/integration/srv_spec.rb +1 -0
  56. data/spec/lite_spec_helper.rb +5 -4
  57. data/spec/mongo/bulk_write_spec.rb +13 -0
  58. data/spec/mongo/client_construction_spec.rb +45 -2
  59. data/spec/mongo/client_encryption_spec.rb +0 -12
  60. data/spec/mongo/client_spec.rb +1 -1
  61. data/spec/mongo/collection/view/aggregation_spec.rb +119 -0
  62. data/spec/mongo/collection/view/readable_spec.rb +630 -5
  63. data/spec/mongo/collection_spec.rb +32 -0
  64. data/spec/mongo/crypt/auto_encrypter_spec.rb +110 -0
  65. data/spec/mongo/crypt/binding/context_spec.rb +3 -35
  66. data/spec/mongo/crypt/data_key_context_spec.rb +1 -1
  67. data/spec/mongo/crypt/explicit_encryption_context_spec.rb +8 -3
  68. data/spec/mongo/crypt/handle_spec.rb +39 -3
  69. data/spec/mongo/crypt/kms/credentials_spec.rb +0 -47
  70. data/spec/mongo/index/view_spec.rb +56 -0
  71. data/spec/mongo/operation/create/op_msg_spec.rb +0 -42
  72. data/spec/mongo/server/connection_pool_spec.rb +26 -4
  73. data/spec/mongo/socket/ssl_spec.rb +3 -3
  74. data/spec/runners/crud/requirement.rb +6 -1
  75. data/spec/runners/crud/test.rb +1 -1
  76. data/spec/runners/transactions/spec.rb +2 -2
  77. data/spec/runners/transactions/test.rb +4 -20
  78. data/spec/runners/transactions.rb +2 -2
  79. data/spec/runners/unified/assertions.rb +32 -2
  80. data/spec/runners/unified/change_stream_operations.rb +3 -0
  81. data/spec/runners/unified/client_side_encryption_operations.rb +83 -0
  82. data/spec/runners/unified/crud_operations.rb +17 -2
  83. data/spec/runners/unified/ddl_operations.rb +27 -2
  84. data/spec/runners/unified/grid_fs_operations.rb +21 -0
  85. data/spec/runners/unified/test.rb +59 -1
  86. data/spec/shared/lib/mrss/docker_runner.rb +2 -0
  87. data/spec/shared/lib/mrss/eg_config_utils.rb +51 -0
  88. data/spec/shared/lib/mrss/lite_constraints.rb +10 -2
  89. data/spec/shared/shlib/set_env.sh +3 -0
  90. data/spec/solo/clean_exit_spec.rb +5 -0
  91. data/spec/spec_tests/client_side_encryption_spec.rb +1 -1
  92. data/spec/spec_tests/client_side_encryption_unified_spec.rb +16 -0
  93. data/spec/spec_tests/data/change_streams_unified/change-streams-showExpandedEvents.yml +298 -0
  94. data/spec/spec_tests/data/client_side_encryption/create-and-createIndexes.yml +58 -0
  95. data/spec/spec_tests/data/client_side_encryption/fle2-Delete.yml +1 -1
  96. data/spec/spec_tests/data/client_side_encryption/fle2-EncryptedFields-vs-jsonSchema.yml +1 -1
  97. data/spec/spec_tests/data/client_side_encryption/fle2-FindOneAndUpdate.yml +2 -2
  98. data/spec/spec_tests/data/client_side_encryption/fle2-InsertFind-Indexed.yml +1 -1
  99. data/spec/spec_tests/data/client_side_encryption/fle2-Update.yml +2 -2
  100. data/spec/spec_tests/data/client_side_encryption/unified/addKeyAltName.yml +194 -0
  101. data/spec/spec_tests/data/client_side_encryption/unified/createDataKey-kms_providers-invalid.yml +67 -0
  102. data/spec/spec_tests/data/client_side_encryption/unified/createDataKey.yml +309 -0
  103. data/spec/spec_tests/data/client_side_encryption/unified/deleteKey.yml +159 -0
  104. data/spec/spec_tests/data/client_side_encryption/unified/getKey.yml +105 -0
  105. data/spec/spec_tests/data/client_side_encryption/unified/getKeyByAltName.yml +104 -0
  106. data/spec/spec_tests/data/client_side_encryption/unified/getKeys.yml +122 -0
  107. data/spec/spec_tests/data/client_side_encryption/unified/removeKeyAltName.yml +157 -0
  108. data/spec/spec_tests/data/client_side_encryption/unified/rewrapManyDataKey-decrypt_failure.yml +69 -0
  109. data/spec/spec_tests/data/client_side_encryption/unified/rewrapManyDataKey-encrypt_failure.yml +122 -0
  110. data/spec/spec_tests/data/client_side_encryption/unified/rewrapManyDataKey.yml +432 -0
  111. data/spec/spec_tests/data/client_side_encryption/validatorAndPartialFieldExpression.yml +166 -0
  112. data/spec/spec_tests/data/command_monitoring_unified/bulkWrite.yml +68 -0
  113. data/spec/spec_tests/data/command_monitoring_unified/command.yml +50 -0
  114. data/spec/spec_tests/data/command_monitoring_unified/deleteMany.yml +79 -0
  115. data/spec/spec_tests/data/command_monitoring_unified/deleteOne.yml +79 -0
  116. data/spec/spec_tests/data/command_monitoring_unified/find.yml +254 -0
  117. data/spec/spec_tests/data/command_monitoring_unified/insertMany.yml +79 -0
  118. data/spec/spec_tests/data/command_monitoring_unified/insertOne.yml +77 -0
  119. data/spec/spec_tests/data/command_monitoring_unified/unacknowledgedBulkWrite.yml +55 -0
  120. data/spec/spec_tests/data/command_monitoring_unified/updateMany.yml +87 -0
  121. data/spec/spec_tests/data/command_monitoring_unified/updateOne.yml +118 -0
  122. data/spec/spec_tests/data/crud_unified/distinct-comment.yml +98 -0
  123. data/spec/spec_tests/data/gridfs_unified/delete.yml +198 -0
  124. data/spec/spec_tests/data/gridfs_unified/download.yml +241 -0
  125. data/spec/spec_tests/data/gridfs_unified/downloadByName.yml +159 -0
  126. data/spec/spec_tests/data/gridfs_unified/upload-disableMD5.yml +92 -0
  127. data/spec/spec_tests/data/gridfs_unified/upload.yml +288 -0
  128. data/spec/spec_tests/gridfs_unified_spec.rb +13 -0
  129. data/spec/stress/connection_pool_timing_spec.rb +2 -2
  130. data/spec/support/background_thread_registry.rb +3 -13
  131. data/spec/support/certificates/atlas-ocsp-ca.crt +40 -47
  132. data/spec/support/certificates/atlas-ocsp.crt +101 -106
  133. data/spec/support/crypt.rb +57 -13
  134. data/spec/support/macros.rb +10 -0
  135. data/spec/support/spec_config.rb +4 -0
  136. data.tar.gz.sig +0 -0
  137. metadata +1271 -1219
  138. metadata.gz.sig +0 -0
  139. data/spec/spec_tests/command_monitoring_spec.rb +0 -71
  140. data/spec/spec_tests/data/command_monitoring/bulkWrite.yml +0 -49
  141. data/spec/spec_tests/data/command_monitoring/command.yml +0 -61
  142. data/spec/spec_tests/data/command_monitoring/deleteMany.yml +0 -55
  143. data/spec/spec_tests/data/command_monitoring/deleteOne.yml +0 -55
  144. data/spec/spec_tests/data/command_monitoring/find.yml +0 -266
  145. data/spec/spec_tests/data/command_monitoring/insertMany.yml +0 -75
  146. data/spec/spec_tests/data/command_monitoring/insertOne.yml +0 -51
  147. data/spec/spec_tests/data/command_monitoring/unacknowledgedBulkWrite.yml +0 -34
  148. data/spec/spec_tests/data/command_monitoring/updateMany.yml +0 -65
  149. data/spec/spec_tests/data/command_monitoring/updateOne.yml +0 -90
metadata.gz.sig CHANGED
Binary file
@@ -1,71 +0,0 @@
1
- # frozen_string_literal: true
2
- # encoding: utf-8
3
-
4
- require 'spec_helper'
5
-
6
- require 'runners/crud'
7
- require 'runners/command_monitoring'
8
-
9
- describe 'Command Monitoring Events' do
10
-
11
- COMMAND_MONITORING_TESTS.each do |file|
12
- context File.basename(file) do
13
-
14
- spec = Mongo::CommandMonitoring::Spec.new(file)
15
-
16
- spec.tests.each do |test|
17
- context(test.description) do
18
-
19
- if test.min_server_fcv
20
- min_server_fcv test.min_server_fcv
21
- end
22
- if test.max_server_version
23
- max_server_version test.max_server_version
24
- end
25
-
26
- let(:subscriber) do
27
- Mrss::EventSubscriber.new
28
- end
29
-
30
- let(:monitoring) do
31
- authorized_client.send(:monitoring)
32
- end
33
-
34
- before do
35
- authorized_collection.find.delete_many
36
- authorized_client.subscribe(Mongo::Monitoring::COMMAND, subscriber)
37
- end
38
-
39
- test.expectations.each_with_index do |expectation, index|
40
-
41
- it "generates a #{expectation.event_name} for #{expectation.command_name}" do
42
- begin
43
- test.run(authorized_collection, subscriber)
44
- check_event(subscriber, index, expectation)
45
- rescue Mongo::Error::OperationFailure, Mongo::Error::BulkWriteError
46
- check_event(subscriber, index, expectation)
47
- end
48
- end
49
- end
50
- end
51
- end
52
- end
53
- end
54
-
55
- def check_event(subscriber, index, expectation)
56
- subscriber.all_events.length.should > index
57
- # TODO move this filtering into Mrss::EventSubscriber
58
- events = subscriber.all_events.reject do |event|
59
- (
60
- event.is_a?(Mongo::Monitoring::Event::CommandStarted) ||
61
- event.is_a?(Mongo::Monitoring::Event::CommandSucceeded) ||
62
- event.is_a?(Mongo::Monitoring::Event::CommandFailed)
63
- ) &&
64
- %w(authenticate getnonce saslStart saslContinue).include?(event.command_name)
65
- end
66
- actual_event = events[index]
67
- expected_event_type = expectation.event_type.sub(/_event$/, '')
68
- Utils.underscore(actual_event.class.name.sub(/.*::/, '')).to_s.should == expected_event_type
69
- expect(actual_event).to send(expectation.matcher, expectation)
70
- end
71
- end
@@ -1,49 +0,0 @@
1
- data:
2
- - { _id: 1, x: 11 }
3
- - { _id: 2, x: 22 }
4
- - { _id: 3, x: 33 }
5
-
6
- collection_name: &collection_name "test"
7
- database_name: &database_name "ruby-driver"
8
-
9
- tests:
10
- -
11
- description: "A successful mixed bulk write"
12
- operation:
13
- name: "bulkWrite"
14
- arguments:
15
- requests:
16
- - name: "insertOne"
17
- arguments:
18
- document: { _id: 4, x: 44 }
19
- - name: "updateOne"
20
- arguments:
21
- filter: { _id: 3 }
22
- update: { $set: { x: 333 } }
23
- expectations:
24
- -
25
- command_started_event:
26
- command:
27
- insert: *collection_name
28
- documents:
29
- - { _id: 4, x: 44 }
30
- ordered: true
31
- command_name: "insert"
32
- database_name: *database_name
33
- -
34
- command_succeeded_event:
35
- reply: { ok: 1.0, n: 1 }
36
- command_name: "insert"
37
- -
38
- command_started_event:
39
- command:
40
- update: *collection_name
41
- updates:
42
- - { q: {_id: 3 }, u: { $set: { x: 333 } } }
43
- ordered: true
44
- command_name: "update"
45
- database_name: *database_name
46
- -
47
- command_succeeded_event:
48
- reply: { ok: 1.0, n: 1 }
49
- command_name: "update"
@@ -1,61 +0,0 @@
1
- data:
2
- - { _id: 1, x: 11 }
3
-
4
- collection_name: &collection_name "test"
5
- database_name: &database_name "ruby-driver"
6
-
7
- tests:
8
- -
9
- description: "A successful command"
10
- operation:
11
- name: "count"
12
- arguments:
13
- filter: { _id: 1 }
14
- expectations:
15
- -
16
- command_started_event:
17
- command:
18
- count: *collection_name
19
- query: { _id: 1 }
20
- command_name: "count"
21
- database_name: *database_name
22
- -
23
- command_succeeded_event:
24
- reply: { ok: 1.0, n: 1 }
25
- command_name: "count"
26
- -
27
- description: "A failed command event"
28
- operation:
29
- name: "count"
30
- arguments:
31
- filter: { $or: true }
32
- expectations:
33
- -
34
- command_started_event:
35
- command:
36
- count: *collection_name
37
- query: { $or: true }
38
- command_name: "count"
39
- database_name: *database_name
40
- -
41
- command_failed_event:
42
- command_name: "count"
43
- -
44
- description: "A successful command with a non-primary read preference"
45
- operation:
46
- name: "count"
47
- arguments:
48
- filter: { _id: 1 }
49
- read_preference: { mode: "primaryPreferred" }
50
- expectations:
51
- -
52
- command_started_event:
53
- command:
54
- count: *collection_name
55
- query: { _id: 1 }
56
- command_name: "count"
57
- database_name: *database_name
58
- -
59
- command_succeeded_event:
60
- reply: { ok: 1.0, n: 1 }
61
- command_name: "count"
@@ -1,55 +0,0 @@
1
- data:
2
- - { _id: 1, x: 11 }
3
- - { _id: 2, x: 22 }
4
- - { _id: 3, x: 33 }
5
-
6
- collection_name: &collection_name "test"
7
- database_name: &database_name "ruby-driver"
8
-
9
- tests:
10
- -
11
- description: "A successful delete many"
12
- operation:
13
- name: "deleteMany"
14
- arguments:
15
- filter:
16
- _id: { $gt: 1 }
17
- expectations:
18
- -
19
- command_started_event:
20
- command:
21
- delete: *collection_name
22
- deletes:
23
- - { q: { _id: { $gt: 1 }}, limit: 0 }
24
- ordered: true
25
- command_name: "delete"
26
- database_name: *database_name
27
- -
28
- command_succeeded_event:
29
- reply: { ok: 1.0, n: 2 }
30
- command_name: "delete"
31
- -
32
- description: "A successful delete many command with write errors"
33
- operation:
34
- name: "deleteMany"
35
- arguments:
36
- filter:
37
- _id: { $nothing: 1 }
38
- expectations:
39
- -
40
- command_started_event:
41
- command:
42
- delete: *collection_name
43
- deletes:
44
- - { q: { _id: { $nothing: 1 }}, limit: 0 }
45
- ordered: true
46
- command_name: "delete"
47
- database_name: *database_name
48
- -
49
- command_succeeded_event:
50
- reply:
51
- ok: 1.0
52
- n: 0
53
- writeErrors:
54
- - { index: 0, code: 42, errmsg: "" }
55
- command_name: "delete"
@@ -1,55 +0,0 @@
1
- data:
2
- - { _id: 1, x: 11 }
3
- - { _id: 2, x: 22 }
4
- - { _id: 3, x: 33 }
5
-
6
- collection_name: &collection_name "test"
7
- database_name: &database_name "ruby-driver"
8
-
9
- tests:
10
- -
11
- description: "A successful delete one"
12
- operation:
13
- name: "deleteOne"
14
- arguments:
15
- filter:
16
- _id: { $gt: 1 }
17
- expectations:
18
- -
19
- command_started_event:
20
- command:
21
- delete: *collection_name
22
- deletes:
23
- - { q: { _id: { $gt: 1 }}, limit: 1 }
24
- ordered: true
25
- command_name: "delete"
26
- database_name: *database_name
27
- -
28
- command_succeeded_event:
29
- reply: { ok: 1.0, n: 1 }
30
- command_name: "delete"
31
- -
32
- description: "A successful delete one command with write errors"
33
- operation:
34
- name: "deleteOne"
35
- arguments:
36
- filter:
37
- _id: { $nothing: 1 }
38
- expectations:
39
- -
40
- command_started_event:
41
- command:
42
- delete: *collection_name
43
- deletes:
44
- - { q: { _id: { $nothing: 1 }}, limit: 1 }
45
- ordered: true
46
- command_name: "delete"
47
- database_name: *database_name
48
- -
49
- command_succeeded_event:
50
- reply:
51
- ok: 1.0
52
- n: 0
53
- writeErrors:
54
- - { index: 0, code: 42, errmsg: "" }
55
- command_name: "delete"
@@ -1,266 +0,0 @@
1
- data:
2
- - { _id: 1, x: 11 }
3
- - { _id: 2, x: 22 }
4
- - { _id: 3, x: 33 }
5
- - { _id: 4, x: 44 }
6
- - { _id: 5, x: 55 }
7
-
8
- collection_name: &collection_name "test"
9
- database_name: &database_name "ruby-driver"
10
- namespace: &namespace "ruby-driver.test"
11
-
12
- tests:
13
- -
14
- description: "A successful find event with no options"
15
- operation:
16
- name: "find"
17
- arguments:
18
- filter: { _id: 1 }
19
- expectations:
20
- -
21
- command_started_event:
22
- command:
23
- find: *collection_name
24
- filter: { _id: 1 }
25
- command_name: "find"
26
- database_name: *database_name
27
- -
28
- command_succeeded_event:
29
- reply:
30
- ok: 1.0
31
- cursor:
32
- id: { $numberLong: "0" }
33
- ns: *namespace
34
- firstBatch:
35
- - { _id: 1, x: 11 }
36
- command_name: "find"
37
- -
38
- description: "A successful find event with options"
39
- operation:
40
- name: "find"
41
- read_preference: { mode: "primaryPreferred" }
42
- arguments:
43
- filter: { _id: { $gt: 1 } }
44
- sort: { _id: 1 }
45
- skip: {"$numberLong": "2"}
46
- comment: "test"
47
- hint: { _id: 1 }
48
- max: { _id: 6 }
49
- maxTimeMS: 6000
50
- min: { _id: 0 }
51
- returnKey: false
52
- showRecordId: false
53
- expectations:
54
- -
55
- command_started_event:
56
- command:
57
- find: *collection_name
58
- filter: { _id: { $gt: 1 } }
59
- sort: { _id: 1 }
60
- skip: {"$numberLong": "2"}
61
- comment: "test"
62
- hint: { _id: 1 }
63
- max: { _id: 6 }
64
- maxTimeMS: 6000
65
- min: { _id: 0 }
66
- returnKey: false
67
- showRecordId: false
68
- command_name: "find"
69
- database_name: *database_name
70
- -
71
- command_succeeded_event:
72
- reply:
73
- ok: 1.0
74
- cursor:
75
- id: { $numberLong: "0" }
76
- ns: *namespace
77
- firstBatch:
78
- - { _id: 4, x: 44 }
79
- - { _id: 5, x: 55 }
80
- command_name: "find"
81
- -
82
- description: "A successful find event with a getmore"
83
- operation:
84
- name: "find"
85
- arguments:
86
- filter: { _id: { $gte: 1 }}
87
- sort: { _id: 1 }
88
- batchSize: {"$numberLong": "3"}
89
- expectations:
90
- -
91
- command_started_event:
92
- command:
93
- find: *collection_name
94
- filter: { _id: { $gte : 1 }}
95
- sort: { _id: 1 }
96
- batchSize: {"$numberLong": "3"}
97
- command_name: "find"
98
- database_name: *database_name
99
- -
100
- command_succeeded_event:
101
- reply:
102
- ok: 1.0
103
- cursor:
104
- id: { $numberLong: "42" }
105
- ns: *namespace
106
- firstBatch:
107
- - { _id: 1, x: 11 }
108
- - { _id: 2, x: 22 }
109
- - { _id: 3, x: 33 }
110
- command_name: "find"
111
- -
112
- command_started_event:
113
- command:
114
- getMore: { $numberLong: "42" }
115
- collection: *collection_name
116
- batchSize: {"$numberLong": "3"}
117
- command_name: "getMore"
118
- database_name: *database_name
119
- -
120
- command_succeeded_event:
121
- reply:
122
- ok: 1.0
123
- cursor:
124
- id: { $numberLong: "0" }
125
- ns: *namespace
126
- nextBatch:
127
- - { _id: 4, x: 44 }
128
- - { _id: 5, x: 55 }
129
- command_name: "getMore"
130
- -
131
- description: "A successful find event with a getmore and killcursors"
132
- ignore_if_server_version_greater_than: "3.0"
133
- operation:
134
- name: "find"
135
- arguments:
136
- filter: { _id: { $gte: 1 }}
137
- sort: { _id: 1 }
138
- batchSize: {"$numberLong": "3"}
139
- limit: {"$numberLong": "4"}
140
- expectations:
141
- -
142
- command_started_event:
143
- command:
144
- find: *collection_name
145
- filter: { _id: { $gte : 1 }}
146
- sort: { _id: 1 }
147
- batchSize: {"$numberLong": "3"}
148
- limit: {"$numberLong": "4"}
149
- command_name: "find"
150
- database_name: *database_name
151
- -
152
- command_succeeded_event:
153
- reply:
154
- ok: 1.0
155
- cursor:
156
- id: { $numberLong: "42" }
157
- ns: *namespace
158
- firstBatch:
159
- - { _id: 1, x: 11 }
160
- - { _id: 2, x: 22 }
161
- - { _id: 3, x: 33 }
162
- command_name: "find"
163
- -
164
- command_started_event:
165
- command:
166
- getMore: { $numberLong: "42" }
167
- collection: *collection_name
168
- batchSize: { $numberLong: "1" }
169
- command_name: "getMore"
170
- database_name: *database_name
171
- -
172
- command_succeeded_event:
173
- reply:
174
- ok: 1.0
175
- cursor:
176
- id: { $numberLong: "42" }
177
- ns: *namespace
178
- nextBatch:
179
- - { _id: 4, x: 44 }
180
- command_name: "getMore"
181
- -
182
- command_started_event:
183
- command:
184
- killCursors: *collection_name
185
- cursors:
186
- - { $numberLong: "42" }
187
- command_name: "killCursors"
188
- database_name: *database_name
189
- -
190
- command_succeeded_event:
191
- reply:
192
- ok: 1.0
193
- cursorsUnknown:
194
- - { $numberLong: "42" }
195
- command_name: "killCursors"
196
- -
197
- description: "A successful find event with a getmore and the server kills the cursor (<= 4.4)"
198
- ignore_if_server_version_less_than: "3.1"
199
- ignore_if_server_version_greater_than: "4.4"
200
- ignore_if_topology_type:
201
- - "sharded"
202
- operation:
203
- name: "find"
204
- arguments:
205
- filter: { _id: { $gte: 1 }}
206
- sort: { _id: 1 }
207
- batchSize: {"$numberLong": "3"}
208
- limit: {"$numberLong": "4"}
209
- expectations:
210
- -
211
- command_started_event:
212
- command:
213
- find: *collection_name
214
- filter: { _id: { $gte : 1 }}
215
- sort: { _id: 1 }
216
- batchSize: {"$numberLong": "3"}
217
- limit: {"$numberLong": "4"}
218
- command_name: "find"
219
- database_name: *database_name
220
- -
221
- command_succeeded_event:
222
- reply:
223
- ok: 1.0
224
- cursor:
225
- id: { $numberLong: "42" }
226
- ns: *namespace
227
- firstBatch:
228
- - { _id: 1, x: 11 }
229
- - { _id: 2, x: 22 }
230
- - { _id: 3, x: 33 }
231
- command_name: "find"
232
- -
233
- command_started_event:
234
- command:
235
- getMore: { $numberLong: "42" }
236
- collection: *collection_name
237
- batchSize: { $numberLong: "1" }
238
- command_name: "getMore"
239
- database_name: *database_name
240
- -
241
- command_succeeded_event:
242
- reply:
243
- ok: 1.0
244
- cursor:
245
- id: { $numberLong: "0" }
246
- ns: *namespace
247
- nextBatch:
248
- - { _id: 4, x: 44 }
249
- command_name: "getMore"
250
- -
251
- description: "A failed find event"
252
- operation:
253
- name: "find"
254
- arguments:
255
- filter: { $or: true }
256
- expectations:
257
- -
258
- command_started_event:
259
- command:
260
- find: *collection_name
261
- filter: { $or: true }
262
- command_name: "find"
263
- database_name: *database_name
264
- -
265
- command_failed_event:
266
- command_name: "find"
@@ -1,75 +0,0 @@
1
- data:
2
- - { _id: 1, x: 11 }
3
-
4
- collection_name: &collection_name "test"
5
- database_name: &database_name "ruby-driver"
6
-
7
- tests:
8
- -
9
- description: "A successful insert many"
10
- operation:
11
- name: "insertMany"
12
- arguments:
13
- documents:
14
- - { _id: 2, x: 22 }
15
- expectations:
16
- -
17
- command_started_event:
18
- command:
19
- insert: *collection_name
20
- documents:
21
- - { _id: 2, x: 22 }
22
- ordered: true
23
- command_name: "insert"
24
- database_name: *database_name
25
- -
26
- command_succeeded_event:
27
- reply: { ok: 1.0, n: 1 }
28
- command_name: "insert"
29
- -
30
- description: "A successful insert many command with write errors"
31
- operation:
32
- name: "insertMany"
33
- arguments:
34
- documents:
35
- - { _id: 1, x: 11 }
36
- expectations:
37
- -
38
- command_started_event:
39
- command:
40
- insert: *collection_name
41
- documents:
42
- - { _id: 1, x: 11 }
43
- ordered: true
44
- command_name: "insert"
45
- database_name: *database_name
46
- -
47
- command_succeeded_event:
48
- reply:
49
- ok: 1.0
50
- n: 0
51
- writeErrors:
52
- - { index: 0, code: 42, errmsg: "" }
53
- command_name: "insert"
54
- -
55
- description: "A successful unordered insert many"
56
- operation:
57
- name: "insertMany"
58
- arguments:
59
- documents:
60
- - { _id: 2, x: 22 }
61
- options: { ordered: false }
62
- expectations:
63
- -
64
- command_started_event:
65
- command:
66
- insert: *collection_name
67
- documents:
68
- - { _id: 2, x: 22 }
69
- ordered: false
70
- command_name: "insert"
71
- database_name: *database_name
72
- -
73
- command_succeeded_event:
74
- reply: { ok: 1.0, n: 1 }
75
- command_name: "insert"
@@ -1,51 +0,0 @@
1
- data:
2
- - { _id: 1, x: 11 }
3
-
4
- collection_name: &collection_name "test"
5
- database_name: &database_name "ruby-driver"
6
-
7
- tests:
8
- -
9
- description: "A successful insert one"
10
- operation:
11
- name: "insertOne"
12
- arguments:
13
- document: { _id: 2, x: 22 }
14
- expectations:
15
- -
16
- command_started_event:
17
- command:
18
- insert: *collection_name
19
- documents:
20
- - { _id: 2, x: 22 }
21
- ordered: true
22
- command_name: "insert"
23
- database_name: *database_name
24
- -
25
- command_succeeded_event:
26
- reply: { ok: 1.0, n: 1 }
27
- command_name: "insert"
28
- -
29
- description: "A successful insert one command with write errors"
30
- operation:
31
- name: "insertOne"
32
- arguments:
33
- document: { _id: 1, x: 11 }
34
- expectations:
35
- -
36
- command_started_event:
37
- command:
38
- insert: *collection_name
39
- documents:
40
- - { _id: 1, x: 11 }
41
- ordered: true
42
- command_name: "insert"
43
- database_name: *database_name
44
- -
45
- command_succeeded_event:
46
- reply:
47
- ok: 1.0
48
- n: 0
49
- writeErrors:
50
- - { index: 0, code: 42, errmsg: "" }
51
- command_name: "insert"