mongo 2.21.0 → 2.21.1
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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/mongo/auth/aws/conversation.rb +1 -1
- data/lib/mongo/auth/credential_cache.rb +13 -6
- data/lib/mongo/client.rb +75 -28
- data/lib/mongo/client_encryption.rb +1 -1
- data/lib/mongo/cluster/sdam_flow.rb +1 -1
- data/lib/mongo/collection/view/aggregation.rb +1 -1
- data/lib/mongo/crypt/binary.rb +5 -5
- data/lib/mongo/crypt/binding.rb +65 -1
- data/lib/mongo/crypt/context.rb +55 -27
- data/lib/mongo/crypt/encryption_io.rb +4 -2
- data/lib/mongo/crypt/handle.rb +1 -1
- data/lib/mongo/cursor.rb +1 -1
- data/lib/mongo/error/kms_error.rb +9 -0
- data/lib/mongo/error/pool_cleared_error.rb +1 -0
- data/lib/mongo/error/sdam_error_detection.rb +3 -3
- data/lib/mongo/lint.rb +1 -1
- data/lib/mongo/monitoring/event/secure.rb +1 -1
- data/lib/mongo/monitoring.rb +1 -1
- data/lib/mongo/operation/shared/read_preference_supported.rb +2 -2
- data/lib/mongo/operation/shared/sessions_supported.rb +2 -2
- data/lib/mongo/protocol/compressed.rb +1 -1
- data/lib/mongo/protocol/msg.rb +1 -1
- data/lib/mongo/search_index/view.rb +4 -4
- data/lib/mongo/server/push_monitor.rb +1 -1
- data/lib/mongo/session/server_session/dirtyable.rb +1 -1
- data/lib/mongo/socket.rb +29 -22
- data/lib/mongo/uri/srv_protocol.rb +3 -1
- data/lib/mongo/version.rb +1 -1
- data/mongo.gemspec +4 -4
- metadata +19 -2799
- data/Rakefile +0 -196
- data/spec/NOTES.aws-auth.md +0 -296
- data/spec/README.aws-auth.md +0 -318
- data/spec/README.md +0 -733
- data/spec/USERS.md +0 -72
- data/spec/atlas/atlas_connectivity_spec.rb +0 -27
- data/spec/atlas/operations_spec.rb +0 -23
- data/spec/faas/ruby-sam-app/Gemfile +0 -9
- data/spec/faas/ruby-sam-app/mongodb/Gemfile +0 -4
- data/spec/faas/ruby-sam-app/mongodb/app.rb +0 -149
- data/spec/faas/ruby-sam-app/template.yaml +0 -48
- data/spec/integration/auth_spec.rb +0 -309
- data/spec/integration/awaited_ismaster_spec.rb +0 -31
- data/spec/integration/aws_auth_credentials_cache_spec.rb +0 -51
- data/spec/integration/aws_auth_request_spec.rb +0 -77
- data/spec/integration/aws_credentials_retriever_spec.rb +0 -136
- data/spec/integration/aws_lambda_examples_spec.rb +0 -68
- data/spec/integration/bson_symbol_spec.rb +0 -39
- data/spec/integration/bulk_insert_spec.rb +0 -83
- data/spec/integration/bulk_write_error_message_spec.rb +0 -74
- data/spec/integration/bulk_write_spec.rb +0 -86
- data/spec/integration/change_stream_examples_spec.rb +0 -208
- data/spec/integration/change_stream_spec.rb +0 -814
- data/spec/integration/check_clean_slate_spec.rb +0 -19
- data/spec/integration/client_authentication_options_spec.rb +0 -514
- data/spec/integration/client_connectivity_spec.rb +0 -41
- data/spec/integration/client_construction_aws_auth_spec.rb +0 -203
- data/spec/integration/client_construction_spec.rb +0 -381
- data/spec/integration/client_side_encryption/auto_encryption_bulk_writes_spec.rb +0 -360
- data/spec/integration/client_side_encryption/auto_encryption_command_monitoring_spec.rb +0 -306
- data/spec/integration/client_side_encryption/auto_encryption_mongocryptd_spawn_spec.rb +0 -75
- data/spec/integration/client_side_encryption/auto_encryption_old_wire_version_spec.rb +0 -82
- data/spec/integration/client_side_encryption/auto_encryption_reconnect_spec.rb +0 -260
- data/spec/integration/client_side_encryption/auto_encryption_spec.rb +0 -754
- data/spec/integration/client_side_encryption/automatic_data_encryption_keys_prose_spec.rb +0 -153
- data/spec/integration/client_side_encryption/bson_size_limit_spec.rb +0 -190
- data/spec/integration/client_side_encryption/bypass_mongocryptd_spawn_spec.rb +0 -81
- data/spec/integration/client_side_encryption/client_close_spec.rb +0 -66
- data/spec/integration/client_side_encryption/corpus_spec.rb +0 -273
- data/spec/integration/client_side_encryption/custom_endpoint_spec.rb +0 -132
- data/spec/integration/client_side_encryption/data_key_spec.rb +0 -258
- data/spec/integration/client_side_encryption/decryption_events_prose_spec.rb +0 -159
- data/spec/integration/client_side_encryption/explicit_encryption_spec.rb +0 -176
- data/spec/integration/client_side_encryption/explicit_queryable_encryption_spec.rb +0 -150
- data/spec/integration/client_side_encryption/external_key_vault_spec.rb +0 -144
- data/spec/integration/client_side_encryption/kms_tls_options_spec.rb +0 -436
- data/spec/integration/client_side_encryption/kms_tls_spec.rb +0 -92
- data/spec/integration/client_side_encryption/mongocryptd_prose_spec.rb +0 -105
- data/spec/integration/client_side_encryption/on_demand_aws_credentials_spec.rb +0 -49
- data/spec/integration/client_side_encryption/on_demand_azure_credentials_spec.rb +0 -46
- data/spec/integration/client_side_encryption/on_demand_gcp_credentials_spec.rb +0 -47
- data/spec/integration/client_side_encryption/queryable_encryption_examples_spec.rb +0 -114
- data/spec/integration/client_side_encryption/range_explicit_encryption_prose_spec.rb +0 -583
- data/spec/integration/client_side_encryption/rewrap_prose_spec.rb +0 -114
- data/spec/integration/client_side_encryption/unique_index_on_key_alt_names_prose_spec.rb +0 -89
- data/spec/integration/client_side_encryption/views_spec.rb +0 -47
- data/spec/integration/client_side_operations_timeout/encryption_prose_spec.rb +0 -131
- data/spec/integration/client_spec.rb +0 -54
- data/spec/integration/client_update_spec.rb +0 -161
- data/spec/integration/collection_indexes_prose_spec.rb +0 -58
- data/spec/integration/command_monitoring_spec.rb +0 -184
- data/spec/integration/command_spec.rb +0 -157
- data/spec/integration/connect_single_rs_name_spec.rb +0 -75
- data/spec/integration/connection/faas_env_spec.rb +0 -62
- data/spec/integration/connection_pool_populator_spec.rb +0 -327
- data/spec/integration/connection_spec.rb +0 -353
- data/spec/integration/crud_spec.rb +0 -378
- data/spec/integration/cursor_pinning_spec.rb +0 -80
- data/spec/integration/cursor_reaping_spec.rb +0 -143
- data/spec/integration/docs_examples_spec.rb +0 -207
- data/spec/integration/error_detection_spec.rb +0 -42
- data/spec/integration/find_options_spec.rb +0 -227
- data/spec/integration/fork_reconnect_spec.rb +0 -207
- data/spec/integration/get_more_spec.rb +0 -42
- data/spec/integration/grid_fs_bucket_spec.rb +0 -51
- data/spec/integration/heartbeat_events_spec.rb +0 -102
- data/spec/integration/map_reduce_spec.rb +0 -81
- data/spec/integration/mmapv1_spec.rb +0 -31
- data/spec/integration/mongos_pinning_spec.rb +0 -37
- data/spec/integration/ocsp_connectivity_spec.rb +0 -29
- data/spec/integration/ocsp_verifier_cache_spec.rb +0 -191
- data/spec/integration/ocsp_verifier_spec.rb +0 -358
- data/spec/integration/operation_failure_code_spec.rb +0 -29
- data/spec/integration/operation_failure_message_spec.rb +0 -91
- data/spec/integration/query_cache_spec.rb +0 -1343
- data/spec/integration/query_cache_transactions_spec.rb +0 -193
- data/spec/integration/read_concern_spec.rb +0 -92
- data/spec/integration/read_preference_spec.rb +0 -548
- data/spec/integration/reconnect_spec.rb +0 -200
- data/spec/integration/retryable_errors_spec.rb +0 -286
- data/spec/integration/retryable_reads_errors_spec.rb +0 -275
- data/spec/integration/retryable_writes/retryable_writes_36_and_older_spec.rb +0 -764
- data/spec/integration/retryable_writes/retryable_writes_40_and_newer_spec.rb +0 -405
- data/spec/integration/retryable_writes/shared/adds_diagnostics.rb +0 -18
- data/spec/integration/retryable_writes/shared/does_not_support_retries.rb +0 -27
- data/spec/integration/retryable_writes/shared/only_supports_legacy_retries.rb +0 -28
- data/spec/integration/retryable_writes/shared/performs_legacy_retries.rb +0 -220
- data/spec/integration/retryable_writes/shared/performs_modern_retries.rb +0 -235
- data/spec/integration/retryable_writes/shared/performs_no_retries.rb +0 -113
- data/spec/integration/retryable_writes/shared/supports_legacy_retries.rb +0 -22
- data/spec/integration/retryable_writes/shared/supports_modern_retries.rb +0 -28
- data/spec/integration/retryable_writes/shared/supports_retries.rb +0 -19
- data/spec/integration/retryable_writes_errors_spec.rb +0 -348
- data/spec/integration/sdam_error_handling_spec.rb +0 -490
- data/spec/integration/sdam_events_spec.rb +0 -178
- data/spec/integration/sdam_prose_spec.rb +0 -67
- data/spec/integration/search_indexes_prose_spec.rb +0 -172
- data/spec/integration/secondary_reads_spec.rb +0 -103
- data/spec/integration/server_description_spec.rb +0 -48
- data/spec/integration/server_monitor_spec.rb +0 -57
- data/spec/integration/server_selection_spec.rb +0 -39
- data/spec/integration/server_selector_spec.rb +0 -107
- data/spec/integration/server_spec.rb +0 -67
- data/spec/integration/shell_examples_spec.rb +0 -984
- data/spec/integration/size_limit_spec.rb +0 -118
- data/spec/integration/snappy_compression_spec.rb +0 -28
- data/spec/integration/snapshot_query_examples_spec.rb +0 -129
- data/spec/integration/srv_monitoring_spec.rb +0 -445
- data/spec/integration/srv_spec.rb +0 -60
- data/spec/integration/ssl_uri_options_spec.rb +0 -28
- data/spec/integration/step_down_spec.rb +0 -225
- data/spec/integration/time_zone_querying_spec.rb +0 -55
- data/spec/integration/transaction_pinning_spec.rb +0 -134
- data/spec/integration/transactions_api_examples_spec.rb +0 -64
- data/spec/integration/transactions_examples_spec.rb +0 -235
- data/spec/integration/truncated_utf8_spec.rb +0 -26
- data/spec/integration/versioned_api_examples_spec.rb +0 -120
- data/spec/integration/x509_auth_spec.rb +0 -112
- data/spec/integration/zlib_compression_spec.rb +0 -28
- data/spec/integration/zstd_compression_spec.rb +0 -29
- data/spec/kerberos/kerberos_spec.rb +0 -98
- data/spec/lite_spec_helper.rb +0 -211
- data/spec/mongo/address/ipv4_spec.rb +0 -102
- data/spec/mongo/address/ipv6_spec.rb +0 -137
- data/spec/mongo/address/unix_spec.rb +0 -45
- data/spec/mongo/address/validator_spec.rb +0 -54
- data/spec/mongo/address_spec.rb +0 -357
- data/spec/mongo/auth/aws/credential_cache_spec.rb +0 -63
- data/spec/mongo/auth/aws/credentials_retriever_spec.rb +0 -90
- data/spec/mongo/auth/aws/credentials_spec.rb +0 -46
- data/spec/mongo/auth/aws/request_region_spec.rb +0 -45
- data/spec/mongo/auth/aws/request_spec.rb +0 -79
- data/spec/mongo/auth/cr_spec.rb +0 -58
- data/spec/mongo/auth/gssapi/conversation_spec.rb +0 -124
- data/spec/mongo/auth/invalid_mechanism_spec.rb +0 -14
- data/spec/mongo/auth/ldap/conversation_spec.rb +0 -46
- data/spec/mongo/auth/ldap_spec.rb +0 -46
- data/spec/mongo/auth/scram/conversation_spec.rb +0 -205
- data/spec/mongo/auth/scram256/conversation_spec.rb +0 -174
- data/spec/mongo/auth/scram_negotiation_spec.rb +0 -532
- data/spec/mongo/auth/scram_spec.rb +0 -121
- data/spec/mongo/auth/stringprep/profiles/sasl_spec.rb +0 -116
- data/spec/mongo/auth/stringprep_spec.rb +0 -191
- data/spec/mongo/auth/user/view_spec.rb +0 -584
- data/spec/mongo/auth/user_spec.rb +0 -343
- data/spec/mongo/auth/x509/conversation_spec.rb +0 -72
- data/spec/mongo/auth/x509_spec.rb +0 -72
- data/spec/mongo/auth_spec.rb +0 -68
- data/spec/mongo/bson_spec.rb +0 -14
- data/spec/mongo/bulk_write/ordered_combiner_spec.rb +0 -287
- data/spec/mongo/bulk_write/result_spec.rb +0 -141
- data/spec/mongo/bulk_write/unordered_combiner_spec.rb +0 -242
- data/spec/mongo/bulk_write_spec.rb +0 -2514
- data/spec/mongo/caching_cursor_spec.rb +0 -73
- data/spec/mongo/client_construction_spec.rb +0 -2723
- data/spec/mongo/client_encryption_spec.rb +0 -403
- data/spec/mongo/client_spec.rb +0 -1357
- data/spec/mongo/cluster/cursor_reaper_spec.rb +0 -230
- data/spec/mongo/cluster/periodic_executor_spec.rb +0 -21
- data/spec/mongo/cluster/socket_reaper_spec.rb +0 -46
- data/spec/mongo/cluster/topology/replica_set_spec.rb +0 -601
- data/spec/mongo/cluster/topology/sharded_spec.rb +0 -158
- data/spec/mongo/cluster/topology/single_spec.rb +0 -192
- data/spec/mongo/cluster/topology/unknown_spec.rb +0 -103
- data/spec/mongo/cluster/topology_spec.rb +0 -211
- data/spec/mongo/cluster_spec.rb +0 -825
- data/spec/mongo/cluster_time_spec.rb +0 -151
- data/spec/mongo/collection/view/aggregation_spec.rb +0 -753
- data/spec/mongo/collection/view/builder/find_command_spec.rb +0 -528
- data/spec/mongo/collection/view/builder/op_query_spec.rb +0 -161
- data/spec/mongo/collection/view/change_stream_resume_spec.rb +0 -397
- data/spec/mongo/collection/view/change_stream_spec.rb +0 -547
- data/spec/mongo/collection/view/explainable_spec.rb +0 -119
- data/spec/mongo/collection/view/immutable_spec.rb +0 -57
- data/spec/mongo/collection/view/iterable_spec.rb +0 -41
- data/spec/mongo/collection/view/map_reduce_spec.rb +0 -907
- data/spec/mongo/collection/view/readable_spec.rb +0 -2283
- data/spec/mongo/collection/view/writable_spec.rb +0 -1976
- data/spec/mongo/collection/view_spec.rb +0 -424
- data/spec/mongo/collection_crud_spec.rb +0 -4472
- data/spec/mongo/collection_ddl_spec.rb +0 -587
- data/spec/mongo/collection_spec.rb +0 -849
- data/spec/mongo/condition_variable_spec.rb +0 -104
- data/spec/mongo/config/options_spec.rb +0 -76
- data/spec/mongo/config_spec.rb +0 -74
- data/spec/mongo/crypt/auto_decryption_context_spec.rb +0 -109
- data/spec/mongo/crypt/auto_encrypter_spec.rb +0 -450
- data/spec/mongo/crypt/auto_encryption_context_spec.rb +0 -126
- data/spec/mongo/crypt/binary_spec.rb +0 -113
- data/spec/mongo/crypt/binding/binary_spec.rb +0 -54
- data/spec/mongo/crypt/binding/context_spec.rb +0 -305
- data/spec/mongo/crypt/binding/helpers_spec.rb +0 -44
- data/spec/mongo/crypt/binding/mongocrypt_spec.rb +0 -113
- data/spec/mongo/crypt/binding/status_spec.rb +0 -97
- data/spec/mongo/crypt/binding/version_spec.rb +0 -67
- data/spec/mongo/crypt/binding_unloaded_spec.rb +0 -37
- data/spec/mongo/crypt/data_key_context_spec.rb +0 -146
- data/spec/mongo/crypt/encryption_io_spec.rb +0 -141
- data/spec/mongo/crypt/explicit_decryption_context_spec.rb +0 -106
- data/spec/mongo/crypt/explicit_encryption_context_spec.rb +0 -266
- data/spec/mongo/crypt/handle_spec.rb +0 -266
- data/spec/mongo/crypt/helpers/mongo_crypt_spec_helper.rb +0 -111
- data/spec/mongo/crypt/hooks_spec.rb +0 -30
- data/spec/mongo/crypt/kms/azure/credentials_retriever_spec.rb +0 -86
- data/spec/mongo/crypt/kms/credentials_spec.rb +0 -373
- data/spec/mongo/crypt/kms_spec.rb +0 -62
- data/spec/mongo/crypt/status_spec.rb +0 -150
- data/spec/mongo/crypt_spec.rb +0 -21
- data/spec/mongo/cursor/builder/get_more_command_spec.rb +0 -195
- data/spec/mongo/cursor/builder/op_get_more_spec.rb +0 -68
- data/spec/mongo/cursor_spec.rb +0 -851
- data/spec/mongo/database_spec.rb +0 -1365
- data/spec/mongo/distinguishing_semaphore_spec.rb +0 -66
- data/spec/mongo/error/bulk_write_error_spec.rb +0 -52
- data/spec/mongo/error/crypt_error_spec.rb +0 -29
- data/spec/mongo/error/max_bson_size_spec.rb +0 -38
- data/spec/mongo/error/no_server_available_spec.rb +0 -35
- data/spec/mongo/error/notable_spec.rb +0 -62
- data/spec/mongo/error/operation_failure_heavy_spec.rb +0 -110
- data/spec/mongo/error/operation_failure_spec.rb +0 -553
- data/spec/mongo/error/parser_spec.rb +0 -519
- data/spec/mongo/error/unsupported_option_spec.rb +0 -57
- data/spec/mongo/event/publisher_spec.rb +0 -53
- data/spec/mongo/event/subscriber_spec.rb +0 -37
- data/spec/mongo/grid/file/chunk_spec.rb +0 -230
- data/spec/mongo/grid/file/info_spec.rb +0 -107
- data/spec/mongo/grid/file_spec.rb +0 -194
- data/spec/mongo/grid/fs_bucket_spec.rb +0 -1269
- data/spec/mongo/grid/stream/read_spec.rb +0 -292
- data/spec/mongo/grid/stream/write_spec.rb +0 -559
- data/spec/mongo/grid/stream_spec.rb +0 -51
- data/spec/mongo/id_spec.rb +0 -38
- data/spec/mongo/index/view_spec.rb +0 -1296
- data/spec/mongo/lint_spec.rb +0 -231
- data/spec/mongo/logger_spec.rb +0 -62
- data/spec/mongo/monitoring/command_log_subscriber_spec.rb +0 -79
- data/spec/mongo/monitoring/event/cmap/connection_check_out_failed_spec.rb +0 -26
- data/spec/mongo/monitoring/event/cmap/connection_check_out_started_spec.rb +0 -22
- data/spec/mongo/monitoring/event/cmap/connection_checked_in_spec.rb +0 -33
- data/spec/mongo/monitoring/event/cmap/connection_checked_out_spec.rb +0 -33
- data/spec/mongo/monitoring/event/cmap/connection_closed_spec.rb +0 -30
- data/spec/mongo/monitoring/event/cmap/connection_created_spec.rb +0 -27
- data/spec/mongo/monitoring/event/cmap/connection_ready_spec.rb +0 -27
- data/spec/mongo/monitoring/event/cmap/pool_cleared_spec.rb +0 -22
- data/spec/mongo/monitoring/event/cmap/pool_closed_spec.rb +0 -29
- data/spec/mongo/monitoring/event/cmap/pool_created_spec.rb +0 -36
- data/spec/mongo/monitoring/event/command_failed_spec.rb +0 -87
- data/spec/mongo/monitoring/event/command_started_spec.rb +0 -51
- data/spec/mongo/monitoring/event/command_succeeded_spec.rb +0 -88
- data/spec/mongo/monitoring/event/secure_spec.rb +0 -123
- data/spec/mongo/monitoring/event/server_closed_spec.rb +0 -38
- data/spec/mongo/monitoring/event/server_description_changed_spec.rb +0 -38
- data/spec/mongo/monitoring/event/server_heartbeat_failed_spec.rb +0 -34
- data/spec/mongo/monitoring/event/server_heartbeat_started_spec.rb +0 -34
- data/spec/mongo/monitoring/event/server_heartbeat_succeeded_spec.rb +0 -34
- data/spec/mongo/monitoring/event/server_opening_spec.rb +0 -38
- data/spec/mongo/monitoring/event/topology_changed_spec.rb +0 -44
- data/spec/mongo/monitoring/event/topology_closed_spec.rb +0 -38
- data/spec/mongo/monitoring/event/topology_opening_spec.rb +0 -38
- data/spec/mongo/monitoring_spec.rb +0 -196
- data/spec/mongo/operation/aggregate/result_spec.rb +0 -90
- data/spec/mongo/operation/aggregate_spec.rb +0 -76
- data/spec/mongo/operation/collections_info_spec.rb +0 -48
- data/spec/mongo/operation/command_spec.rb +0 -86
- data/spec/mongo/operation/context_spec.rb +0 -79
- data/spec/mongo/operation/create/op_msg_spec.rb +0 -240
- data/spec/mongo/operation/create_index_spec.rb +0 -62
- data/spec/mongo/operation/create_user_spec.rb +0 -53
- data/spec/mongo/operation/delete/bulk_spec.rb +0 -245
- data/spec/mongo/operation/delete/op_msg_spec.rb +0 -267
- data/spec/mongo/operation/delete_spec.rb +0 -203
- data/spec/mongo/operation/drop_index_spec.rb +0 -61
- data/spec/mongo/operation/find/builder/flags_spec.rb +0 -109
- data/spec/mongo/operation/find/builder/modifiers_spec.rb +0 -213
- data/spec/mongo/operation/find/op_msg_spec.rb +0 -66
- data/spec/mongo/operation/get_more/op_msg_spec.rb +0 -65
- data/spec/mongo/operation/indexes_spec.rb +0 -41
- data/spec/mongo/operation/insert/bulk_spec.rb +0 -273
- data/spec/mongo/operation/insert/op_msg_spec.rb +0 -293
- data/spec/mongo/operation/insert_spec.rb +0 -258
- data/spec/mongo/operation/limited_spec.rb +0 -55
- data/spec/mongo/operation/map_reduce_spec.rb +0 -131
- data/spec/mongo/operation/read_preference_legacy_spec.rb +0 -360
- data/spec/mongo/operation/read_preference_op_msg_spec.rb +0 -332
- data/spec/mongo/operation/remove_user_spec.rb +0 -52
- data/spec/mongo/operation/result_spec.rb +0 -369
- data/spec/mongo/operation/shared/csot/examples.rb +0 -113
- data/spec/mongo/operation/specifiable_spec.rb +0 -87
- data/spec/mongo/operation/update/bulk_spec.rb +0 -239
- data/spec/mongo/operation/update/op_msg_spec.rb +0 -272
- data/spec/mongo/operation/update_spec.rb +0 -235
- data/spec/mongo/operation/update_user_spec.rb +0 -52
- data/spec/mongo/options/redacted_spec.rb +0 -353
- data/spec/mongo/protocol/caching_hash_spec.rb +0 -37
- data/spec/mongo/protocol/compressed_spec.rb +0 -83
- data/spec/mongo/protocol/get_more_spec.rb +0 -164
- data/spec/mongo/protocol/kill_cursors_spec.rb +0 -121
- data/spec/mongo/protocol/msg_spec.rb +0 -507
- data/spec/mongo/protocol/query_spec.rb +0 -347
- data/spec/mongo/protocol/registry_spec.rb +0 -34
- data/spec/mongo/protocol/reply_spec.rb +0 -198
- data/spec/mongo/query_cache_middleware_spec.rb +0 -55
- data/spec/mongo/query_cache_spec.rb +0 -471
- data/spec/mongo/retryable/write_worker_spec.rb +0 -39
- data/spec/mongo/retryable_spec.rb +0 -624
- data/spec/mongo/semaphore_spec.rb +0 -54
- data/spec/mongo/server/app_metadata/environment_spec.rb +0 -344
- data/spec/mongo/server/app_metadata/truncator_spec.rb +0 -158
- data/spec/mongo/server/app_metadata_spec.rb +0 -158
- data/spec/mongo/server/connection_auth_spec.rb +0 -138
- data/spec/mongo/server/connection_common_spec.rb +0 -87
- data/spec/mongo/server/connection_pool/populator_spec.rb +0 -120
- data/spec/mongo/server/connection_pool_spec.rb +0 -1609
- data/spec/mongo/server/connection_spec.rb +0 -1310
- data/spec/mongo/server/description/features_spec.rb +0 -274
- data/spec/mongo/server/description_query_methods_spec.rb +0 -291
- data/spec/mongo/server/description_spec.rb +0 -846
- data/spec/mongo/server/monitor/app_metadata_spec.rb +0 -25
- data/spec/mongo/server/monitor/connection_spec.rb +0 -197
- data/spec/mongo/server/monitor_spec.rb +0 -326
- data/spec/mongo/server/push_monitor_spec.rb +0 -95
- data/spec/mongo/server/round_trip_time_calculator_spec.rb +0 -120
- data/spec/mongo/server_selector/nearest_spec.rb +0 -338
- data/spec/mongo/server_selector/primary_preferred_spec.rb +0 -372
- data/spec/mongo/server_selector/primary_spec.rb +0 -181
- data/spec/mongo/server_selector/secondary_preferred_spec.rb +0 -350
- data/spec/mongo/server_selector/secondary_spec.rb +0 -278
- data/spec/mongo/server_selector_spec.rb +0 -736
- data/spec/mongo/server_spec.rb +0 -463
- data/spec/mongo/session/server_session_spec.rb +0 -62
- data/spec/mongo/session/session_pool_spec.rb +0 -257
- data/spec/mongo/session_spec.rb +0 -368
- data/spec/mongo/session_transaction_spec.rb +0 -222
- data/spec/mongo/socket/ssl_spec.rb +0 -830
- data/spec/mongo/socket/tcp_spec.rb +0 -17
- data/spec/mongo/socket/unix_spec.rb +0 -56
- data/spec/mongo/socket_spec.rb +0 -119
- data/spec/mongo/srv/monitor_spec.rb +0 -233
- data/spec/mongo/srv/result_spec.rb +0 -57
- data/spec/mongo/timeout_spec.rb +0 -42
- data/spec/mongo/tls_context_hooks_spec.rb +0 -40
- data/spec/mongo/uri/options_mapper_spec.rb +0 -1605
- data/spec/mongo/uri/srv_protocol_spec.rb +0 -1367
- data/spec/mongo/uri_option_parsing_spec.rb +0 -625
- data/spec/mongo/uri_spec.rb +0 -1443
- data/spec/mongo/utils_spec.rb +0 -42
- data/spec/mongo/write_concern/acknowledged_spec.rb +0 -58
- data/spec/mongo/write_concern/unacknowledged_spec.rb +0 -29
- data/spec/mongo/write_concern_spec.rb +0 -227
- data/spec/runners/auth.rb +0 -140
- data/spec/runners/change_streams/outcome.rb +0 -45
- data/spec/runners/change_streams/spec.rb +0 -60
- data/spec/runners/change_streams/test.rb +0 -232
- data/spec/runners/cmap/verifier.rb +0 -48
- data/spec/runners/cmap.rb +0 -516
- data/spec/runners/command_monitoring.rb +0 -346
- data/spec/runners/connection_string.rb +0 -393
- data/spec/runners/crud/context.rb +0 -30
- data/spec/runners/crud/operation.rb +0 -480
- data/spec/runners/crud/outcome.rb +0 -56
- data/spec/runners/crud/requirement.rb +0 -139
- data/spec/runners/crud/spec.rb +0 -76
- data/spec/runners/crud/test.rb +0 -115
- data/spec/runners/crud/test_base.rb +0 -53
- data/spec/runners/crud/verifier.rb +0 -224
- data/spec/runners/crud.rb +0 -257
- data/spec/runners/gridfs.rb +0 -641
- data/spec/runners/read_write_concern_document.rb +0 -70
- data/spec/runners/sdam/verifier.rb +0 -112
- data/spec/runners/sdam.rb +0 -279
- data/spec/runners/server_selection.rb +0 -365
- data/spec/runners/server_selection_rtt.rb +0 -41
- data/spec/runners/transactions/operation.rb +0 -332
- data/spec/runners/transactions/spec.rb +0 -29
- data/spec/runners/transactions/test.rb +0 -379
- data/spec/runners/transactions.rb +0 -107
- data/spec/runners/unified/ambiguous_operations.rb +0 -13
- data/spec/runners/unified/assertions.rb +0 -396
- data/spec/runners/unified/change_stream_operations.rb +0 -42
- data/spec/runners/unified/client_side_encryption_operations.rb +0 -83
- data/spec/runners/unified/crud_operations.rb +0 -367
- data/spec/runners/unified/ddl_operations.rb +0 -286
- data/spec/runners/unified/entity_map.rb +0 -42
- data/spec/runners/unified/error.rb +0 -29
- data/spec/runners/unified/event_subscriber.rb +0 -110
- data/spec/runners/unified/exceptions.rb +0 -24
- data/spec/runners/unified/grid_fs_operations.rb +0 -114
- data/spec/runners/unified/search_index_operations.rb +0 -63
- data/spec/runners/unified/support_operations.rb +0 -370
- data/spec/runners/unified/test.rb +0 -606
- data/spec/runners/unified/test_group.rb +0 -31
- data/spec/runners/unified/thread_operations.rb +0 -73
- data/spec/runners/unified.rb +0 -109
- data/spec/solo/clean_exit_spec.rb +0 -24
- data/spec/spec_helper.rb +0 -35
- data/spec/spec_tests/auth_spec.rb +0 -58
- data/spec/spec_tests/change_streams_unified_spec.rb +0 -14
- data/spec/spec_tests/client_side_encryption_spec.rb +0 -37
- data/spec/spec_tests/client_side_encryption_unified_spec.rb +0 -26
- data/spec/spec_tests/client_side_operations_timeout_spec.rb +0 -15
- data/spec/spec_tests/cmap_spec.rb +0 -126
- data/spec/spec_tests/collection_management_spec.rb +0 -13
- data/spec/spec_tests/command_monitoring_unified_spec.rb +0 -13
- data/spec/spec_tests/connection_string_spec.rb +0 -10
- data/spec/spec_tests/crud_spec.rb +0 -12
- data/spec/spec_tests/crud_unified_spec.rb +0 -13
- data/spec/spec_tests/data/auth/connection-string.yml +0 -366
- data/spec/spec_tests/data/change_streams_unified/change-streams-clusterTime.yml +0 -43
- data/spec/spec_tests/data/change_streams_unified/change-streams-disambiguatedPaths.yml +0 -105
- data/spec/spec_tests/data/change_streams_unified/change-streams-errors.yml +0 -122
- data/spec/spec_tests/data/change_streams_unified/change-streams-pre_and_post_images.yml +0 -351
- data/spec/spec_tests/data/change_streams_unified/change-streams-resume-allowlist.yml +0 -1169
- data/spec/spec_tests/data/change_streams_unified/change-streams-resume-errorLabels.yml +0 -1069
- data/spec/spec_tests/data/change_streams_unified/change-streams-showExpandedEvents.yml +0 -307
- data/spec/spec_tests/data/change_streams_unified/change-streams.yml +0 -927
- data/spec/spec_tests/data/client_side_encryption/aggregate.yml +0 -120
- data/spec/spec_tests/data/client_side_encryption/awsTemporary.yml +0 -57
- data/spec/spec_tests/data/client_side_encryption/azureKMS.yml +0 -46
- data/spec/spec_tests/data/client_side_encryption/badQueries.yml +0 -537
- data/spec/spec_tests/data/client_side_encryption/badSchema.yml +0 -73
- data/spec/spec_tests/data/client_side_encryption/basic.yml +0 -102
- data/spec/spec_tests/data/client_side_encryption/bulk.yml +0 -81
- data/spec/spec_tests/data/client_side_encryption/bypassAutoEncryption.yml +0 -100
- data/spec/spec_tests/data/client_side_encryption/bypassedCommand.yml +0 -43
- data/spec/spec_tests/data/client_side_encryption/count.yml +0 -54
- data/spec/spec_tests/data/client_side_encryption/countDocuments.yml +0 -52
- data/spec/spec_tests/data/client_side_encryption/create-and-createIndexes.yml +0 -58
- data/spec/spec_tests/data/client_side_encryption/delete.yml +0 -91
- data/spec/spec_tests/data/client_side_encryption/distinct.yml +0 -66
- data/spec/spec_tests/data/client_side_encryption/explain.yml +0 -57
- data/spec/spec_tests/data/client_side_encryption/find.yml +0 -105
- data/spec/spec_tests/data/client_side_encryption/findOneAndDelete.yml +0 -50
- data/spec/spec_tests/data/client_side_encryption/findOneAndReplace.yml +0 -50
- data/spec/spec_tests/data/client_side_encryption/findOneAndUpdate.yml +0 -50
- data/spec/spec_tests/data/client_side_encryption/fle2v2-BypassQueryAnalysis.yml +0 -90
- data/spec/spec_tests/data/client_side_encryption/fle2v2-Compact.yml +0 -83
- data/spec/spec_tests/data/client_side_encryption/fle2v2-CreateCollection-OldServer.yml +0 -61
- data/spec/spec_tests/data/client_side_encryption/fle2v2-CreateCollection.yml +0 -938
- data/spec/spec_tests/data/client_side_encryption/fle2v2-DecryptExistingData.yml +0 -67
- data/spec/spec_tests/data/client_side_encryption/fle2v2-Delete.yml +0 -101
- data/spec/spec_tests/data/client_side_encryption/fle2v2-EncryptedFields-vs-EncryptedFieldsMap.yml +0 -80
- data/spec/spec_tests/data/client_side_encryption/fle2v2-EncryptedFields-vs-jsonSchema.yml +0 -103
- data/spec/spec_tests/data/client_side_encryption/fle2v2-EncryptedFieldsMap-defaults.yml +0 -59
- data/spec/spec_tests/data/client_side_encryption/fle2v2-FindOneAndUpdate.yml +0 -201
- data/spec/spec_tests/data/client_side_encryption/fle2v2-InsertFind-Indexed.yml +0 -97
- data/spec/spec_tests/data/client_side_encryption/fle2v2-InsertFind-Unindexed.yml +0 -90
- data/spec/spec_tests/data/client_side_encryption/fle2v2-MissingKey.yml +0 -44
- data/spec/spec_tests/data/client_side_encryption/fle2v2-NoEncryption.yml +0 -45
- data/spec/spec_tests/data/client_side_encryption/fle2v2-Update.yml +0 -211
- data/spec/spec_tests/data/client_side_encryption/fle2v2-validatorAndPartialFieldExpression.yml +0 -170
- data/spec/spec_tests/data/client_side_encryption/gcpKMS.yml +0 -46
- data/spec/spec_tests/data/client_side_encryption/getMore.yml +0 -61
- data/spec/spec_tests/data/client_side_encryption/insert.yml +0 -88
- data/spec/spec_tests/data/client_side_encryption/keyAltName.yml +0 -64
- data/spec/spec_tests/data/client_side_encryption/localKMS.yml +0 -47
- data/spec/spec_tests/data/client_side_encryption/localSchema.yml +0 -65
- data/spec/spec_tests/data/client_side_encryption/malformedCiphertext.yml +0 -69
- data/spec/spec_tests/data/client_side_encryption/maxWireVersion.yml +0 -22
- data/spec/spec_tests/data/client_side_encryption/missingKey.yml +0 -42
- data/spec/spec_tests/data/client_side_encryption/noSchema.yml +0 -39
- data/spec/spec_tests/data/client_side_encryption/replaceOne.yml +0 -57
- data/spec/spec_tests/data/client_side_encryption/timeoutMS.yml +0 -67
- data/spec/spec_tests/data/client_side_encryption/types.yml +0 -501
- data/spec/spec_tests/data/client_side_encryption/unified/addKeyAltName.yml +0 -194
- data/spec/spec_tests/data/client_side_encryption/unified/createDataKey-kms_providers-invalid.yml +0 -67
- data/spec/spec_tests/data/client_side_encryption/unified/createDataKey.yml +0 -309
- data/spec/spec_tests/data/client_side_encryption/unified/deleteKey.yml +0 -159
- data/spec/spec_tests/data/client_side_encryption/unified/getKey.yml +0 -105
- data/spec/spec_tests/data/client_side_encryption/unified/getKeyByAltName.yml +0 -104
- data/spec/spec_tests/data/client_side_encryption/unified/getKeys.yml +0 -122
- data/spec/spec_tests/data/client_side_encryption/unified/removeKeyAltName.yml +0 -157
- data/spec/spec_tests/data/client_side_encryption/unified/rewrapManyDataKey-decrypt_failure.yml +0 -69
- data/spec/spec_tests/data/client_side_encryption/unified/rewrapManyDataKey-encrypt_failure.yml +0 -122
- data/spec/spec_tests/data/client_side_encryption/unified/rewrapManyDataKey.yml +0 -432
- data/spec/spec_tests/data/client_side_encryption/unsupportedCommand.yml +0 -25
- data/spec/spec_tests/data/client_side_encryption/updateMany.yml +0 -70
- data/spec/spec_tests/data/client_side_encryption/updateOne.yml +0 -164
- data/spec/spec_tests/data/client_side_encryption/validatorAndPartialFieldExpression.yml +0 -166
- data/spec/spec_tests/data/client_side_operations_timeout/bulkWrite.yml +0 -87
- data/spec/spec_tests/data/client_side_operations_timeout/change-streams.yml +0 -358
- data/spec/spec_tests/data/client_side_operations_timeout/close-cursors.yml +0 -129
- data/spec/spec_tests/data/client_side_operations_timeout/command-execution.yml +0 -250
- data/spec/spec_tests/data/client_side_operations_timeout/convenient-transactions.yml +0 -113
- data/spec/spec_tests/data/client_side_operations_timeout/cursors.yml +0 -70
- data/spec/spec_tests/data/client_side_operations_timeout/deprecated-options.yml +0 -3982
- data/spec/spec_tests/data/client_side_operations_timeout/error-transformations.yml +0 -96
- data/spec/spec_tests/data/client_side_operations_timeout/global-timeoutMS.yml +0 -3236
- data/spec/spec_tests/data/client_side_operations_timeout/gridfs-advanced.yml +0 -207
- data/spec/spec_tests/data/client_side_operations_timeout/gridfs-delete.yml +0 -152
- data/spec/spec_tests/data/client_side_operations_timeout/gridfs-download.yml +0 -182
- data/spec/spec_tests/data/client_side_operations_timeout/gridfs-find.yml +0 -100
- data/spec/spec_tests/data/client_side_operations_timeout/gridfs-upload.yml +0 -249
- data/spec/spec_tests/data/client_side_operations_timeout/legacy-timeouts.yml +0 -204
- data/spec/spec_tests/data/client_side_operations_timeout/non-tailable-cursors.yml +0 -307
- data/spec/spec_tests/data/client_side_operations_timeout/override-collection-timeoutMS.yml +0 -1877
- data/spec/spec_tests/data/client_side_operations_timeout/override-operation-timeoutMS.yml +0 -1918
- data/spec/spec_tests/data/client_side_operations_timeout/retryability-legacy-timeouts.yml +0 -1676
- data/spec/spec_tests/data/client_side_operations_timeout/retryability-timeoutMS.yml +0 -2824
- data/spec/spec_tests/data/client_side_operations_timeout/sessions-inherit-timeoutMS.yml +0 -168
- data/spec/spec_tests/data/client_side_operations_timeout/sessions-override-operation-timeoutMS.yml +0 -171
- data/spec/spec_tests/data/client_side_operations_timeout/sessions-override-timeoutMS.yml +0 -168
- data/spec/spec_tests/data/client_side_operations_timeout/tailable-awaitData.yml +0 -247
- data/spec/spec_tests/data/client_side_operations_timeout/tailable-non-awaitData.yml +0 -181
- data/spec/spec_tests/data/cmap/connection-must-have-id.yml +0 -29
- data/spec/spec_tests/data/cmap/connection-must-order-ids.yml +0 -29
- data/spec/spec_tests/data/cmap/pool-checkin-destroy-closed.yml +0 -29
- data/spec/spec_tests/data/cmap/pool-checkin-destroy-stale.yml +0 -29
- data/spec/spec_tests/data/cmap/pool-checkin-make-available.yml +0 -26
- data/spec/spec_tests/data/cmap/pool-checkin.yml +0 -24
- data/spec/spec_tests/data/cmap/pool-checkout-connection.yml +0 -21
- data/spec/spec_tests/data/cmap/pool-checkout-custom-maxConnecting-is-enforced.yml +0 -50
- data/spec/spec_tests/data/cmap/pool-checkout-error-closed.yml +0 -38
- data/spec/spec_tests/data/cmap/pool-checkout-maxConnecting-is-enforced.yml +0 -81
- data/spec/spec_tests/data/cmap/pool-checkout-maxConnecting-timeout.yml +0 -71
- data/spec/spec_tests/data/cmap/pool-checkout-minPoolSize-connection-maxConnecting.yml +0 -64
- data/spec/spec_tests/data/cmap/pool-checkout-multiple.yml +0 -39
- data/spec/spec_tests/data/cmap/pool-checkout-no-idle.yml +0 -41
- data/spec/spec_tests/data/cmap/pool-checkout-no-stale.yml +0 -41
- data/spec/spec_tests/data/cmap/pool-checkout-returned-connection-maxConnecting.yml +0 -88
- data/spec/spec_tests/data/cmap/pool-clear-interrupting-pending-connections.yml +0 -43
- data/spec/spec_tests/data/cmap/pool-clear-min-size.yml +0 -41
- data/spec/spec_tests/data/cmap/pool-clear-paused.yml +0 -18
- data/spec/spec_tests/data/cmap/pool-clear-ready.yml +0 -39
- data/spec/spec_tests/data/cmap/pool-clear-schedule-run-interruptInUseConnections-false.yml +0 -48
- data/spec/spec_tests/data/cmap/pool-close-destroy-conns.yml +0 -30
- data/spec/spec_tests/data/cmap/pool-close.yml +0 -11
- data/spec/spec_tests/data/cmap/pool-create-max-size.yml +0 -73
- data/spec/spec_tests/data/cmap/pool-create-min-size-error.yml +0 -43
- data/spec/spec_tests/data/cmap/pool-create-min-size.yml +0 -43
- data/spec/spec_tests/data/cmap/pool-create-with-options.yml +0 -21
- data/spec/spec_tests/data/cmap/pool-create.yml +0 -12
- data/spec/spec_tests/data/cmap/pool-ready-ready.yml +0 -22
- data/spec/spec_tests/data/cmap/pool-ready.yml +0 -30
- data/spec/spec_tests/data/cmap/wait-queue-fairness.yml +0 -126
- data/spec/spec_tests/data/cmap/wait-queue-timeout.yml +0 -51
- data/spec/spec_tests/data/collection_management/clustered-indexes.yml +0 -135
- data/spec/spec_tests/data/collection_management/createCollection-pre_and_post_images.yml +0 -50
- data/spec/spec_tests/data/collection_management/modifyCollection-errorResponse.yml +0 -59
- data/spec/spec_tests/data/collection_management/modifyCollection-pre_and_post_images.yml +0 -58
- data/spec/spec_tests/data/collection_management/timeseries-collection.yml +0 -164
- data/spec/spec_tests/data/command_monitoring_unified/bulkWrite.yml +0 -68
- data/spec/spec_tests/data/command_monitoring_unified/command.yml +0 -50
- data/spec/spec_tests/data/command_monitoring_unified/deleteMany.yml +0 -79
- data/spec/spec_tests/data/command_monitoring_unified/deleteOne.yml +0 -79
- data/spec/spec_tests/data/command_monitoring_unified/find.yml +0 -254
- data/spec/spec_tests/data/command_monitoring_unified/insertMany.yml +0 -79
- data/spec/spec_tests/data/command_monitoring_unified/insertOne.yml +0 -77
- data/spec/spec_tests/data/command_monitoring_unified/pre-42-server-connection-id.yml +0 -56
- data/spec/spec_tests/data/command_monitoring_unified/redacted-commands.yml +0 -348
- data/spec/spec_tests/data/command_monitoring_unified/server-connection-id.yml +0 -56
- data/spec/spec_tests/data/command_monitoring_unified/unacknowledgedBulkWrite.yml +0 -55
- data/spec/spec_tests/data/command_monitoring_unified/updateMany.yml +0 -87
- data/spec/spec_tests/data/command_monitoring_unified/updateOne.yml +0 -118
- data/spec/spec_tests/data/command_monitoring_unified/writeConcernError.yml +0 -80
- data/spec/spec_tests/data/connection_string/invalid-uris.yml +0 -251
- data/spec/spec_tests/data/connection_string/valid-auth.yml +0 -257
- data/spec/spec_tests/data/connection_string/valid-db-with-dotted-name.yml +0 -77
- data/spec/spec_tests/data/connection_string/valid-host_identifiers.yml +0 -121
- data/spec/spec_tests/data/connection_string/valid-options.yml +0 -30
- data/spec/spec_tests/data/connection_string/valid-unix_socket-absolute.yml +0 -197
- data/spec/spec_tests/data/connection_string/valid-unix_socket-relative.yml +0 -213
- data/spec/spec_tests/data/connection_string/valid-warnings.yml +0 -75
- data/spec/spec_tests/data/crud/read/aggregate-collation.yml +0 -18
- data/spec/spec_tests/data/crud/read/aggregate-out.yml +0 -44
- data/spec/spec_tests/data/crud/read/aggregate.yml +0 -21
- data/spec/spec_tests/data/crud/read/count-collation.yml +0 -26
- data/spec/spec_tests/data/crud/read/count-empty.yml +0 -29
- data/spec/spec_tests/data/crud/read/count.yml +0 -74
- data/spec/spec_tests/data/crud/read/distinct-collation.yml +0 -18
- data/spec/spec_tests/data/crud/read/distinct.yml +0 -32
- data/spec/spec_tests/data/crud/read/find-collation.yml +0 -16
- data/spec/spec_tests/data/crud/read/find.yml +0 -49
- data/spec/spec_tests/data/crud/write/bulkWrite-arrayFilters.yml +0 -45
- data/spec/spec_tests/data/crud/write/bulkWrite-collation.yml +0 -102
- data/spec/spec_tests/data/crud/write/bulkWrite.yml +0 -405
- data/spec/spec_tests/data/crud/write/deleteMany-collation.yml +0 -23
- data/spec/spec_tests/data/crud/write/deleteMany.yml +0 -35
- data/spec/spec_tests/data/crud/write/deleteOne-collation.yml +0 -23
- data/spec/spec_tests/data/crud/write/deleteOne.yml +0 -48
- data/spec/spec_tests/data/crud/write/findOneAndDelete-collation.yml +0 -24
- data/spec/spec_tests/data/crud/write/findOneAndDelete.yml +0 -53
- data/spec/spec_tests/data/crud/write/findOneAndReplace-collation.yml +0 -25
- data/spec/spec_tests/data/crud/write/findOneAndReplace-upsert.yml +0 -91
- data/spec/spec_tests/data/crud/write/findOneAndReplace-upsert_pre_2.6.yml +0 -88
- data/spec/spec_tests/data/crud/write/findOneAndReplace.yml +0 -113
- data/spec/spec_tests/data/crud/write/findOneAndUpdate-arrayFilters.yml +0 -69
- data/spec/spec_tests/data/crud/write/findOneAndUpdate-collation.yml +0 -28
- data/spec/spec_tests/data/crud/write/findOneAndUpdate.yml +0 -163
- data/spec/spec_tests/data/crud/write/insertMany.yml +0 -81
- data/spec/spec_tests/data/crud/write/insertOne.yml +0 -18
- data/spec/spec_tests/data/crud/write/replaceOne-collation.yml +0 -25
- data/spec/spec_tests/data/crud/write/replaceOne-pre_2.6.yml +0 -98
- data/spec/spec_tests/data/crud/write/replaceOne-upsert.yml +0 -48
- data/spec/spec_tests/data/crud/write/replaceOne.yml +0 -102
- data/spec/spec_tests/data/crud/write/updateMany-arrayFilters.yml +0 -66
- data/spec/spec_tests/data/crud/write/updateMany-collation.yml +0 -29
- data/spec/spec_tests/data/crud/write/updateMany-pre_2.6.yml +0 -86
- data/spec/spec_tests/data/crud/write/updateMany.yml +0 -87
- data/spec/spec_tests/data/crud/write/updateOne-arrayFilters.yml +0 -114
- data/spec/spec_tests/data/crud/write/updateOne-collation.yml +0 -26
- data/spec/spec_tests/data/crud/write/updateOne-pre_2.6.yml +0 -83
- data/spec/spec_tests/data/crud/write/updateOne.yml +0 -84
- data/spec/spec_tests/data/crud_unified/aggregate-allowdiskuse.yml +0 -75
- data/spec/spec_tests/data/crud_unified/aggregate-let.yml +0 -138
- data/spec/spec_tests/data/crud_unified/aggregate-merge-errorResponse.yml +0 -42
- data/spec/spec_tests/data/crud_unified/aggregate-merge.yml +0 -185
- data/spec/spec_tests/data/crud_unified/aggregate-out-readConcern.yml +0 -171
- data/spec/spec_tests/data/crud_unified/aggregate-write-readPreference.yml +0 -161
- data/spec/spec_tests/data/crud_unified/aggregate.yml +0 -215
- data/spec/spec_tests/data/crud_unified/bulkWrite-arrayFilters-clientError.yml +0 -98
- data/spec/spec_tests/data/crud_unified/bulkWrite-arrayFilters.yml +0 -174
- data/spec/spec_tests/data/crud_unified/bulkWrite-comment.yml +0 -189
- data/spec/spec_tests/data/crud_unified/bulkWrite-delete-hint-clientError.yml +0 -113
- data/spec/spec_tests/data/crud_unified/bulkWrite-delete-hint-serverError.yml +0 -142
- data/spec/spec_tests/data/crud_unified/bulkWrite-delete-hint.yml +0 -154
- data/spec/spec_tests/data/crud_unified/bulkWrite-deleteMany-hint-unacknowledged.yml +0 -98
- data/spec/spec_tests/data/crud_unified/bulkWrite-deleteMany-let.yml +0 -86
- data/spec/spec_tests/data/crud_unified/bulkWrite-deleteOne-hint-unacknowledged.yml +0 -97
- data/spec/spec_tests/data/crud_unified/bulkWrite-deleteOne-let.yml +0 -86
- data/spec/spec_tests/data/crud_unified/bulkWrite-errorResponse.yml +0 -50
- data/spec/spec_tests/data/crud_unified/bulkWrite-insertOne-dots_and_dollars.yml +0 -138
- data/spec/spec_tests/data/crud_unified/bulkWrite-replaceOne-dots_and_dollars.yml +0 -165
- data/spec/spec_tests/data/crud_unified/bulkWrite-replaceOne-hint-unacknowledged.yml +0 -103
- data/spec/spec_tests/data/crud_unified/bulkWrite-replaceOne-let.yml +0 -93
- data/spec/spec_tests/data/crud_unified/bulkWrite-update-hint-clientError.yml +0 -148
- data/spec/spec_tests/data/crud_unified/bulkWrite-update-hint-serverError.yml +0 -239
- data/spec/spec_tests/data/crud_unified/bulkWrite-update-hint.yml +0 -256
- data/spec/spec_tests/data/crud_unified/bulkWrite-update-validation.yml +0 -73
- data/spec/spec_tests/data/crud_unified/bulkWrite-updateMany-dots_and_dollars.yml +0 -150
- data/spec/spec_tests/data/crud_unified/bulkWrite-updateMany-hint-unacknowledged.yml +0 -104
- data/spec/spec_tests/data/crud_unified/bulkWrite-updateMany-let.yml +0 -96
- data/spec/spec_tests/data/crud_unified/bulkWrite-updateOne-dots_and_dollars.yml +0 -150
- data/spec/spec_tests/data/crud_unified/bulkWrite-updateOne-hint-unacknowledged.yml +0 -103
- data/spec/spec_tests/data/crud_unified/bulkWrite-updateOne-let.yml +0 -95
- data/spec/spec_tests/data/crud_unified/countDocuments-comment.yml +0 -92
- data/spec/spec_tests/data/crud_unified/db-aggregate-write-readPreference.yml +0 -157
- data/spec/spec_tests/data/crud_unified/db-aggregate.yml +0 -73
- data/spec/spec_tests/data/crud_unified/deleteMany-comment.yml +0 -97
- data/spec/spec_tests/data/crud_unified/deleteMany-hint-clientError.yml +0 -87
- data/spec/spec_tests/data/crud_unified/deleteMany-hint-serverError.yml +0 -107
- data/spec/spec_tests/data/crud_unified/deleteMany-hint-unacknowledged.yml +0 -90
- data/spec/spec_tests/data/crud_unified/deleteMany-hint.yml +0 -99
- data/spec/spec_tests/data/crud_unified/deleteMany-let.yml +0 -93
- data/spec/spec_tests/data/crud_unified/deleteOne-comment.yml +0 -98
- data/spec/spec_tests/data/crud_unified/deleteOne-errorResponse.yml +0 -46
- data/spec/spec_tests/data/crud_unified/deleteOne-hint-clientError.yml +0 -80
- data/spec/spec_tests/data/crud_unified/deleteOne-hint-serverError.yml +0 -100
- data/spec/spec_tests/data/crud_unified/deleteOne-hint-unacknowledged.yml +0 -89
- data/spec/spec_tests/data/crud_unified/deleteOne-hint.yml +0 -95
- data/spec/spec_tests/data/crud_unified/deleteOne-let.yml +0 -91
- data/spec/spec_tests/data/crud_unified/distinct-comment.yml +0 -98
- data/spec/spec_tests/data/crud_unified/estimatedDocumentCount-comment.yml +0 -95
- data/spec/spec_tests/data/crud_unified/estimatedDocumentCount.yml +0 -181
- data/spec/spec_tests/data/crud_unified/find-allowdiskuse-clientError.yml +0 -55
- data/spec/spec_tests/data/crud_unified/find-allowdiskuse-serverError.yml +0 -68
- data/spec/spec_tests/data/crud_unified/find-allowdiskuse.yml +0 -79
- data/spec/spec_tests/data/crud_unified/find-comment.yml +0 -166
- data/spec/spec_tests/data/crud_unified/find-let.yml +0 -71
- data/spec/spec_tests/data/crud_unified/find-test-all-options.yml +0 -377
- data/spec/spec_tests/data/crud_unified/find.yml +0 -68
- data/spec/spec_tests/data/crud_unified/findOneAndDelete-comment.yml +0 -96
- data/spec/spec_tests/data/crud_unified/findOneAndDelete-hint-clientError.yml +0 -91
- data/spec/spec_tests/data/crud_unified/findOneAndDelete-hint-serverError.yml +0 -107
- data/spec/spec_tests/data/crud_unified/findOneAndDelete-hint-unacknowledged.yml +0 -88
- data/spec/spec_tests/data/crud_unified/findOneAndDelete-hint.yml +0 -102
- data/spec/spec_tests/data/crud_unified/findOneAndDelete-let.yml +0 -86
- data/spec/spec_tests/data/crud_unified/findOneAndReplace-comment.yml +0 -101
- data/spec/spec_tests/data/crud_unified/findOneAndReplace-dots_and_dollars.yml +0 -140
- data/spec/spec_tests/data/crud_unified/findOneAndReplace-hint-clientError.yml +0 -83
- data/spec/spec_tests/data/crud_unified/findOneAndReplace-hint-serverError.yml +0 -99
- data/spec/spec_tests/data/crud_unified/findOneAndReplace-hint-unacknowledged.yml +0 -96
- data/spec/spec_tests/data/crud_unified/findOneAndReplace-hint.yml +0 -98
- data/spec/spec_tests/data/crud_unified/findOneAndReplace-let.yml +0 -94
- data/spec/spec_tests/data/crud_unified/findOneAndUpdate-comment.yml +0 -95
- data/spec/spec_tests/data/crud_unified/findOneAndUpdate-dots_and_dollars.yml +0 -127
- data/spec/spec_tests/data/crud_unified/findOneAndUpdate-errorResponse.yml +0 -69
- data/spec/spec_tests/data/crud_unified/findOneAndUpdate-hint-clientError.yml +0 -84
- data/spec/spec_tests/data/crud_unified/findOneAndUpdate-hint-serverError.yml +0 -100
- data/spec/spec_tests/data/crud_unified/findOneAndUpdate-hint-unacknowledged.yml +0 -92
- data/spec/spec_tests/data/crud_unified/findOneAndUpdate-hint.yml +0 -99
- data/spec/spec_tests/data/crud_unified/findOneAndUpdate-let.yml +0 -96
- data/spec/spec_tests/data/crud_unified/insertMany-comment.yml +0 -93
- data/spec/spec_tests/data/crud_unified/insertMany-dots_and_dollars.yml +0 -128
- data/spec/spec_tests/data/crud_unified/insertOne-comment.yml +0 -91
- data/spec/spec_tests/data/crud_unified/insertOne-dots_and_dollars.yml +0 -238
- data/spec/spec_tests/data/crud_unified/insertOne-errorResponse.yml +0 -46
- data/spec/spec_tests/data/crud_unified/replaceOne-comment.yml +0 -105
- data/spec/spec_tests/data/crud_unified/replaceOne-dots_and_dollars.yml +0 -180
- data/spec/spec_tests/data/crud_unified/replaceOne-hint-unacknowledged.yml +0 -95
- data/spec/spec_tests/data/crud_unified/replaceOne-hint.yml +0 -108
- data/spec/spec_tests/data/crud_unified/replaceOne-let.yml +0 -98
- data/spec/spec_tests/data/crud_unified/replaceOne-validation.yml +0 -37
- data/spec/spec_tests/data/crud_unified/updateMany-comment.yml +0 -104
- data/spec/spec_tests/data/crud_unified/updateMany-dots_and_dollars.yml +0 -138
- data/spec/spec_tests/data/crud_unified/updateMany-hint-clientError.yml +0 -91
- data/spec/spec_tests/data/crud_unified/updateMany-hint-serverError.yml +0 -115
- data/spec/spec_tests/data/crud_unified/updateMany-hint-unacknowledged.yml +0 -96
- data/spec/spec_tests/data/crud_unified/updateMany-hint.yml +0 -115
- data/spec/spec_tests/data/crud_unified/updateMany-let.yml +0 -107
- data/spec/spec_tests/data/crud_unified/updateMany-validation.yml +0 -39
- data/spec/spec_tests/data/crud_unified/updateOne-comment.yml +0 -104
- data/spec/spec_tests/data/crud_unified/updateOne-dots_and_dollars.yml +0 -138
- data/spec/spec_tests/data/crud_unified/updateOne-errorResponse.yml +0 -47
- data/spec/spec_tests/data/crud_unified/updateOne-hint-clientError.yml +0 -85
- data/spec/spec_tests/data/crud_unified/updateOne-hint-serverError.yml +0 -109
- data/spec/spec_tests/data/crud_unified/updateOne-hint-unacknowledged.yml +0 -95
- data/spec/spec_tests/data/crud_unified/updateOne-hint.yml +0 -109
- data/spec/spec_tests/data/crud_unified/updateOne-let.yml +0 -102
- data/spec/spec_tests/data/crud_unified/updateOne-validation.yml +0 -37
- data/spec/spec_tests/data/crud_unified/updateWithPipelines.yml +0 -299
- data/spec/spec_tests/data/gridfs/delete.yml +0 -123
- data/spec/spec_tests/data/gridfs/download.yml +0 -192
- data/spec/spec_tests/data/gridfs/download_by_name.yml +0 -113
- data/spec/spec_tests/data/gridfs/upload.yml +0 -158
- data/spec/spec_tests/data/gridfs_unified/delete.yml +0 -198
- data/spec/spec_tests/data/gridfs_unified/download.yml +0 -241
- data/spec/spec_tests/data/gridfs_unified/downloadByName.yml +0 -159
- data/spec/spec_tests/data/gridfs_unified/upload-disableMD5.yml +0 -92
- data/spec/spec_tests/data/gridfs_unified/upload.yml +0 -288
- data/spec/spec_tests/data/index_management/createSearchIndex.yml +0 -64
- data/spec/spec_tests/data/index_management/createSearchIndexes.yml +0 -86
- data/spec/spec_tests/data/index_management/dropSearchIndex.yml +0 -43
- data/spec/spec_tests/data/index_management/listSearchIndexes.yml +0 -91
- data/spec/spec_tests/data/index_management/updateSearchIndex.yml +0 -46
- data/spec/spec_tests/data/load_balancers/event-monitoring.yml +0 -99
- data/spec/spec_tests/data/load_balancers/lb-connection-establishment.yml +0 -36
- data/spec/spec_tests/data/load_balancers/non-lb-connection-establishment.yml +0 -56
- data/spec/spec_tests/data/load_balancers/server-selection.yml +0 -50
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/DefaultNoMaxStaleness.yml +0 -26
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/Incompatible.yml +0 -25
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/LastUpdateTime.yml +0 -33
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/MaxStalenessTooSmall.yml +0 -15
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/Nearest.yml +0 -33
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/Nearest2.yml +0 -33
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/NoKnownServers.yml +0 -16
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/PrimaryPreferred.yml +0 -27
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/PrimaryPreferred_tags.yml +0 -36
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/Secondary.yml +0 -51
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/SecondaryPreferred.yml +0 -26
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/SecondaryPreferred_tags.yml +0 -51
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/ZeroMaxStaleness.yml +0 -23
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/DefaultNoMaxStaleness.yml +0 -26
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/Incompatible.yml +0 -25
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/LastUpdateTime.yml +0 -35
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/LongHeartbeat.yml +0 -29
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/LongHeartbeat2.yml +0 -25
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/MaxStalenessTooSmall.yml +0 -26
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/MaxStalenessWithModePrimary.yml +0 -23
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/Nearest.yml +0 -33
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/Nearest2.yml +0 -33
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/Nearest_tags.yml +0 -36
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/PrimaryPreferred.yml +0 -27
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/PrimaryPreferred_incompatible.yml +0 -27
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/SecondaryPreferred.yml +0 -26
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/SecondaryPreferred_tags.yml +0 -59
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/SecondaryPreferred_tags2.yml +0 -43
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/Secondary_tags.yml +0 -59
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/Secondary_tags2.yml +0 -43
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/ZeroMaxStaleness.yml +0 -23
- data/spec/spec_tests/data/max_staleness/Sharded/Incompatible.yml +0 -25
- data/spec/spec_tests/data/max_staleness/Sharded/SmallMaxStaleness.yml +0 -28
- data/spec/spec_tests/data/max_staleness/Single/Incompatible.yml +0 -18
- data/spec/spec_tests/data/max_staleness/Single/SmallMaxStaleness.yml +0 -20
- data/spec/spec_tests/data/max_staleness/Unknown/SmallMaxStaleness.yml +0 -15
- data/spec/spec_tests/data/read_write_concern/connection-string/read-concern.yml +0 -32
- data/spec/spec_tests/data/read_write_concern/connection-string/write-concern.yml +0 -79
- data/spec/spec_tests/data/read_write_concern/document/read-concern.yml +0 -37
- data/spec/spec_tests/data/read_write_concern/document/write-concern.yml +0 -100
- data/spec/spec_tests/data/read_write_concern/operation/default-write-concern-2.6.yml +0 -215
- data/spec/spec_tests/data/read_write_concern/operation/default-write-concern-3.2.yml +0 -58
- data/spec/spec_tests/data/read_write_concern/operation/default-write-concern-3.4.yml +0 -95
- data/spec/spec_tests/data/read_write_concern/operation/default-write-concern-4.2.yml +0 -36
- data/spec/spec_tests/data/retryable_reads/legacy/aggregate-merge.yml +0 -39
- data/spec/spec_tests/data/retryable_reads/legacy/aggregate-serverErrors.yml +0 -157
- data/spec/spec_tests/data/retryable_reads/legacy/aggregate.yml +0 -87
- data/spec/spec_tests/data/retryable_reads/legacy/changeStreams-client.watch-serverErrors.yml +0 -150
- data/spec/spec_tests/data/retryable_reads/legacy/changeStreams-client.watch.yml +0 -62
- data/spec/spec_tests/data/retryable_reads/legacy/changeStreams-db.coll.watch-serverErrors.yml +0 -150
- data/spec/spec_tests/data/retryable_reads/legacy/changeStreams-db.coll.watch.yml +0 -66
- data/spec/spec_tests/data/retryable_reads/legacy/changeStreams-db.watch-serverErrors.yml +0 -154
- data/spec/spec_tests/data/retryable_reads/legacy/changeStreams-db.watch.yml +0 -62
- data/spec/spec_tests/data/retryable_reads/legacy/count-serverErrors.yml +0 -150
- data/spec/spec_tests/data/retryable_reads/legacy/count.yml +0 -64
- data/spec/spec_tests/data/retryable_reads/legacy/countDocuments-serverErrors.yml +0 -150
- data/spec/spec_tests/data/retryable_reads/legacy/countDocuments.yml +0 -64
- data/spec/spec_tests/data/retryable_reads/legacy/distinct-serverErrors.yml +0 -156
- data/spec/spec_tests/data/retryable_reads/legacy/distinct.yml +0 -71
- data/spec/spec_tests/data/retryable_reads/legacy/estimatedDocumentCount-serverErrors.yml +0 -148
- data/spec/spec_tests/data/retryable_reads/legacy/estimatedDocumentCount.yml +0 -62
- data/spec/spec_tests/data/retryable_reads/legacy/find-serverErrors.yml +0 -160
- data/spec/spec_tests/data/retryable_reads/legacy/find.yml +0 -86
- data/spec/spec_tests/data/retryable_reads/legacy/findOne-serverErrors.yml +0 -154
- data/spec/spec_tests/data/retryable_reads/legacy/findOne.yml +0 -68
- data/spec/spec_tests/data/retryable_reads/legacy/gridfs-download-serverErrors.yml +0 -173
- data/spec/spec_tests/data/retryable_reads/legacy/gridfs-download.yml +0 -79
- data/spec/spec_tests/data/retryable_reads/legacy/gridfs-downloadByName-serverErrors.yml +0 -174
- data/spec/spec_tests/data/retryable_reads/legacy/gridfs-downloadByName.yml +0 -79
- data/spec/spec_tests/data/retryable_reads/legacy/listCollectionNames-serverErrors.yml +0 -143
- data/spec/spec_tests/data/retryable_reads/legacy/listCollectionNames.yml +0 -59
- data/spec/spec_tests/data/retryable_reads/legacy/listCollectionObjects-serverErrors.yml +0 -144
- data/spec/spec_tests/data/retryable_reads/legacy/listCollectionObjects.yml +0 -59
- data/spec/spec_tests/data/retryable_reads/legacy/listCollections-serverErrors.yml +0 -143
- data/spec/spec_tests/data/retryable_reads/legacy/listCollections.yml +0 -59
- data/spec/spec_tests/data/retryable_reads/legacy/listDatabaseNames-serverErrors.yml +0 -143
- data/spec/spec_tests/data/retryable_reads/legacy/listDatabaseNames.yml +0 -59
- data/spec/spec_tests/data/retryable_reads/legacy/listDatabaseObjects-serverErrors.yml +0 -144
- data/spec/spec_tests/data/retryable_reads/legacy/listDatabaseObjects.yml +0 -59
- data/spec/spec_tests/data/retryable_reads/legacy/listDatabases-serverErrors.yml +0 -144
- data/spec/spec_tests/data/retryable_reads/legacy/listDatabases.yml +0 -59
- data/spec/spec_tests/data/retryable_reads/legacy/listIndexNames-serverErrors.yml +0 -144
- data/spec/spec_tests/data/retryable_reads/legacy/listIndexNames.yml +0 -60
- data/spec/spec_tests/data/retryable_reads/legacy/listIndexes-serverErrors.yml +0 -145
- data/spec/spec_tests/data/retryable_reads/legacy/listIndexes.yml +0 -60
- data/spec/spec_tests/data/retryable_reads/legacy/mapReduce.yml +0 -62
- data/spec/spec_tests/data/retryable_reads/unified/handshakeError.yml +0 -1342
- data/spec/spec_tests/data/retryable_writes/legacy/bulkWrite-errorLabels.yml +0 -77
- data/spec/spec_tests/data/retryable_writes/legacy/bulkWrite-serverErrors.yml +0 -130
- data/spec/spec_tests/data/retryable_writes/legacy/bulkWrite.yml +0 -402
- data/spec/spec_tests/data/retryable_writes/legacy/deleteMany.yml +0 -22
- data/spec/spec_tests/data/retryable_writes/legacy/deleteOne-errorLabels.yml +0 -48
- data/spec/spec_tests/data/retryable_writes/legacy/deleteOne-serverErrors.yml +0 -73
- data/spec/spec_tests/data/retryable_writes/legacy/deleteOne.yml +0 -57
- data/spec/spec_tests/data/retryable_writes/legacy/findOneAndDelete-errorLabels.yml +0 -49
- data/spec/spec_tests/data/retryable_writes/legacy/findOneAndDelete-serverErrors.yml +0 -74
- data/spec/spec_tests/data/retryable_writes/legacy/findOneAndDelete.yml +0 -58
- data/spec/spec_tests/data/retryable_writes/legacy/findOneAndReplace-errorLabels.yml +0 -52
- data/spec/spec_tests/data/retryable_writes/legacy/findOneAndReplace-serverErrors.yml +0 -80
- data/spec/spec_tests/data/retryable_writes/legacy/findOneAndReplace.yml +0 -63
- data/spec/spec_tests/data/retryable_writes/legacy/findOneAndUpdate-errorLabels.yml +0 -52
- data/spec/spec_tests/data/retryable_writes/legacy/findOneAndUpdate-serverErrors.yml +0 -79
- data/spec/spec_tests/data/retryable_writes/legacy/findOneAndUpdate.yml +0 -62
- data/spec/spec_tests/data/retryable_writes/legacy/insertMany-errorLabels.yml +0 -54
- data/spec/spec_tests/data/retryable_writes/legacy/insertMany-serverErrors.yml +0 -84
- data/spec/spec_tests/data/retryable_writes/legacy/insertMany.yml +0 -74
- data/spec/spec_tests/data/retryable_writes/legacy/insertOne-errorLabels.yml +0 -44
- data/spec/spec_tests/data/retryable_writes/legacy/insertOne-serverErrors.yml +0 -527
- data/spec/spec_tests/data/retryable_writes/legacy/insertOne.yml +0 -61
- data/spec/spec_tests/data/retryable_writes/legacy/replaceOne-errorLabels.yml +0 -53
- data/spec/spec_tests/data/retryable_writes/legacy/replaceOne-serverErrors.yml +0 -82
- data/spec/spec_tests/data/retryable_writes/legacy/replaceOne.yml +0 -66
- data/spec/spec_tests/data/retryable_writes/legacy/updateMany.yml +0 -27
- data/spec/spec_tests/data/retryable_writes/legacy/updateOne-errorLabels.yml +0 -53
- data/spec/spec_tests/data/retryable_writes/legacy/updateOne-serverErrors.yml +0 -82
- data/spec/spec_tests/data/retryable_writes/legacy/updateOne.yml +0 -129
- data/spec/spec_tests/data/retryable_writes/unified/bulkWrite-serverErrors.yml +0 -93
- data/spec/spec_tests/data/retryable_writes/unified/handshakeError.yml +0 -785
- data/spec/spec_tests/data/retryable_writes/unified/insertOne-noWritesPerformedError.yml +0 -54
- data/spec/spec_tests/data/retryable_writes/unified/insertOne-serverErrors.yml +0 -75
- data/spec/spec_tests/data/run_command_unified/runCommand.yml +0 -319
- data/spec/spec_tests/data/sdam/errors/error_handling_handshake.yml +0 -55
- data/spec/spec_tests/data/sdam/errors/non-stale-network-error.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/non-stale-network-timeout-error.yml +0 -38
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-greater-InterruptedAtShutdown.yml +0 -61
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-greater-InterruptedDueToReplStateChange.yml +0 -61
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-greater-LegacyNotPrimary.yml +0 -61
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-greater-NotPrimaryNoSecondaryOk.yml +0 -61
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-greater-NotPrimaryOrSecondary.yml +0 -61
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-greater-NotWritablePrimary.yml +0 -61
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-greater-PrimarySteppedDown.yml +0 -61
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-greater-ShutdownInProgress.yml +0 -61
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-missing-InterruptedAtShutdown.yml +0 -52
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-missing-InterruptedDueToReplStateChange.yml +0 -52
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-missing-LegacyNotPrimary.yml +0 -52
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-missing-NotPrimaryNoSecondaryOk.yml +0 -52
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-missing-NotPrimaryOrSecondary.yml +0 -52
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-missing-NotWritablePrimary.yml +0 -52
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-missing-PrimarySteppedDown.yml +0 -52
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-missing-ShutdownInProgress.yml +0 -52
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-proccessId-changed-InterruptedAtShutdown.yml +0 -61
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-proccessId-changed-InterruptedDueToReplStateChange.yml +0 -61
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-proccessId-changed-LegacyNotPrimary.yml +0 -61
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-proccessId-changed-NotPrimaryNoSecondaryOk.yml +0 -61
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-proccessId-changed-NotPrimaryOrSecondary.yml +0 -61
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-proccessId-changed-NotWritablePrimary.yml +0 -61
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-proccessId-changed-PrimarySteppedDown.yml +0 -61
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-proccessId-changed-ShutdownInProgress.yml +0 -61
- data/spec/spec_tests/data/sdam/errors/post-42-InterruptedAtShutdown.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/post-42-InterruptedDueToReplStateChange.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/post-42-LegacyNotPrimary.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/post-42-NotPrimaryNoSecondaryOk.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/post-42-NotPrimaryOrSecondary.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/post-42-NotWritablePrimary.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/post-42-PrimarySteppedDown.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/post-42-ShutdownInProgress.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/pre-42-InterruptedAtShutdown.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/pre-42-InterruptedDueToReplStateChange.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/pre-42-LegacyNotPrimary.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/pre-42-NotPrimaryNoSecondaryOk.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/pre-42-NotPrimaryOrSecondary.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/pre-42-NotWritablePrimary.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/pre-42-PrimarySteppedDown.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/pre-42-ShutdownInProgress.yml +0 -47
- data/spec/spec_tests/data/sdam/errors/prefer-error-code.yml +0 -54
- data/spec/spec_tests/data/sdam/errors/stale-generation-InterruptedAtShutdown.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-InterruptedDueToReplStateChange.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-NotPrimaryNoSecondaryOk.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-NotPrimaryOrSecondary.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-NotWritablePrimary.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-PrimarySteppedDown.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-ShutdownInProgress.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-InterruptedAtShutdown.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-InterruptedDueToReplStateChange.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-LegacyNotPrimary.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-NotPrimaryNoSecondaryOk.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-NotPrimaryOrSecondary.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-NotWritablePrimary.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-PrimarySteppedDown.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-ShutdownInProgress.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-network.yml +0 -82
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-timeout.yml +0 -82
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-InterruptedAtShutdown.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-InterruptedDueToReplStateChange.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-LegacyNotPrimary.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-NotPrimaryNoSecondaryOk.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-NotPrimaryOrSecondary.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-NotWritablePrimary.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-PrimarySteppedDown.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-ShutdownInProgress.yml +0 -91
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-network.yml +0 -82
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-timeout.yml +0 -82
- data/spec/spec_tests/data/sdam/errors/stale-topologyVersion-InterruptedAtShutdown.yml +0 -65
- data/spec/spec_tests/data/sdam/errors/stale-topologyVersion-InterruptedDueToReplStateChange.yml +0 -65
- data/spec/spec_tests/data/sdam/errors/stale-topologyVersion-LegacyNotPrimary.yml +0 -65
- data/spec/spec_tests/data/sdam/errors/stale-topologyVersion-NotPrimaryNoSecondaryOk.yml +0 -65
- data/spec/spec_tests/data/sdam/errors/stale-topologyVersion-NotPrimaryOrSecondary.yml +0 -65
- data/spec/spec_tests/data/sdam/errors/stale-topologyVersion-NotWritablePrimary.yml +0 -65
- data/spec/spec_tests/data/sdam/errors/stale-topologyVersion-PrimarySteppedDown.yml +0 -65
- data/spec/spec_tests/data/sdam/errors/stale-topologyVersion-ShutdownInProgress.yml +0 -65
- data/spec/spec_tests/data/sdam/errors/write_errors_ignored.yml +0 -42
- data/spec/spec_tests/data/sdam/load-balanced/discover_load_balancer.yml +0 -25
- data/spec/spec_tests/data/sdam/rs/compatible.yml +0 -45
- data/spec/spec_tests/data/sdam/rs/compatible_unknown.yml +0 -34
- data/spec/spec_tests/data/sdam/rs/discover_arbiters.yml +0 -44
- data/spec/spec_tests/data/sdam/rs/discover_arbiters_replicaset.yml +0 -44
- data/spec/spec_tests/data/sdam/rs/discover_ghost.yml +0 -36
- data/spec/spec_tests/data/sdam/rs/discover_ghost_replicaset.yml +0 -42
- data/spec/spec_tests/data/sdam/rs/discover_hidden.yml +0 -51
- data/spec/spec_tests/data/sdam/rs/discover_hidden_replicaset.yml +0 -51
- data/spec/spec_tests/data/sdam/rs/discover_passives.yml +0 -83
- data/spec/spec_tests/data/sdam/rs/discover_passives_replicaset.yml +0 -83
- data/spec/spec_tests/data/sdam/rs/discover_primary.yml +0 -43
- data/spec/spec_tests/data/sdam/rs/discover_primary_replicaset.yml +0 -43
- data/spec/spec_tests/data/sdam/rs/discover_rsother.yml +0 -50
- data/spec/spec_tests/data/sdam/rs/discover_rsother_replicaset.yml +0 -68
- data/spec/spec_tests/data/sdam/rs/discover_secondary.yml +0 -44
- data/spec/spec_tests/data/sdam/rs/discover_secondary_replicaset.yml +0 -44
- data/spec/spec_tests/data/sdam/rs/discovery.yml +0 -207
- data/spec/spec_tests/data/sdam/rs/electionId_precedence_setVersion.yml +0 -62
- data/spec/spec_tests/data/sdam/rs/equal_electionids.yml +0 -57
- data/spec/spec_tests/data/sdam/rs/hosts_differ_from_seeds.yml +0 -37
- data/spec/spec_tests/data/sdam/rs/incompatible_arbiter.yml +0 -36
- data/spec/spec_tests/data/sdam/rs/incompatible_ghost.yml +0 -34
- data/spec/spec_tests/data/sdam/rs/incompatible_other.yml +0 -36
- data/spec/spec_tests/data/sdam/rs/ls_timeout.yml +0 -249
- data/spec/spec_tests/data/sdam/rs/member_reconfig.yml +0 -74
- data/spec/spec_tests/data/sdam/rs/member_standalone.yml +0 -66
- data/spec/spec_tests/data/sdam/rs/new_primary.yml +0 -80
- data/spec/spec_tests/data/sdam/rs/new_primary_new_electionid.yml +0 -119
- data/spec/spec_tests/data/sdam/rs/new_primary_new_setversion.yml +0 -119
- data/spec/spec_tests/data/sdam/rs/new_primary_wrong_set_name.yml +0 -77
- data/spec/spec_tests/data/sdam/rs/non_rs_member.yml +0 -33
- data/spec/spec_tests/data/sdam/rs/normalize_case.yml +0 -52
- data/spec/spec_tests/data/sdam/rs/normalize_case_me.yml +0 -102
- data/spec/spec_tests/data/sdam/rs/null_election_id-pre-6.0.yml +0 -175
- data/spec/spec_tests/data/sdam/rs/null_election_id.yml +0 -177
- data/spec/spec_tests/data/sdam/rs/primary_becomes_ghost.yml +0 -65
- data/spec/spec_tests/data/sdam/rs/primary_becomes_mongos.yml +0 -58
- data/spec/spec_tests/data/sdam/rs/primary_becomes_standalone.yml +0 -55
- data/spec/spec_tests/data/sdam/rs/primary_changes_set_name.yml +0 -63
- data/spec/spec_tests/data/sdam/rs/primary_disconnect.yml +0 -59
- data/spec/spec_tests/data/sdam/rs/primary_disconnect_electionid.yml +0 -189
- data/spec/spec_tests/data/sdam/rs/primary_disconnect_setversion.yml +0 -189
- data/spec/spec_tests/data/sdam/rs/primary_hint_from_secondary_with_mismatched_me.yml +0 -64
- data/spec/spec_tests/data/sdam/rs/primary_mismatched_me.yml +0 -27
- data/spec/spec_tests/data/sdam/rs/primary_mismatched_me_not_removed.yml +0 -75
- data/spec/spec_tests/data/sdam/rs/primary_reports_new_member.yml +0 -175
- data/spec/spec_tests/data/sdam/rs/primary_to_no_primary_mismatched_me.yml +0 -81
- data/spec/spec_tests/data/sdam/rs/primary_wrong_set_name.yml +0 -30
- data/spec/spec_tests/data/sdam/rs/repeated.yml +0 -105
- data/spec/spec_tests/data/sdam/rs/replicaset_rsnp.yml +0 -21
- data/spec/spec_tests/data/sdam/rs/response_from_removed.yml +0 -69
- data/spec/spec_tests/data/sdam/rs/ruby_primary_address_change.yml +0 -31
- data/spec/spec_tests/data/sdam/rs/ruby_secondary_wrong_set_name_with_primary_second.yml +0 -73
- data/spec/spec_tests/data/sdam/rs/sec_not_auth.yml +0 -55
- data/spec/spec_tests/data/sdam/rs/secondary_ignore_ok_0-pre-6.0.yml +0 -87
- data/spec/spec_tests/data/sdam/rs/secondary_ignore_ok_0.yml +0 -87
- data/spec/spec_tests/data/sdam/rs/secondary_mismatched_me.yml +0 -28
- data/spec/spec_tests/data/sdam/rs/secondary_wrong_set_name.yml +0 -31
- data/spec/spec_tests/data/sdam/rs/secondary_wrong_set_name_with_primary.yml +0 -75
- data/spec/spec_tests/data/sdam/rs/set_version_can_rollback.yml +0 -101
- data/spec/spec_tests/data/sdam/rs/setversion_equal_max_without_electionid.yml +0 -78
- data/spec/spec_tests/data/sdam/rs/setversion_greaterthan_max_without_electionid.yml +0 -79
- data/spec/spec_tests/data/sdam/rs/setversion_without_electionid-pre-6.0.yml +0 -79
- data/spec/spec_tests/data/sdam/rs/setversion_without_electionid.yml +0 -78
- data/spec/spec_tests/data/sdam/rs/stepdown_change_set_name.yml +0 -65
- data/spec/spec_tests/data/sdam/rs/too_new.yml +0 -45
- data/spec/spec_tests/data/sdam/rs/too_old.yml +0 -41
- data/spec/spec_tests/data/sdam/rs/topology_version_equal.yml +0 -68
- data/spec/spec_tests/data/sdam/rs/topology_version_greater.yml +0 -194
- data/spec/spec_tests/data/sdam/rs/topology_version_less.yml +0 -64
- data/spec/spec_tests/data/sdam/rs/unexpected_mongos.yml +0 -29
- data/spec/spec_tests/data/sdam/rs/use_setversion_without_electionid-pre-6.0.yml +0 -117
- data/spec/spec_tests/data/sdam/rs/use_setversion_without_electionid.yml +0 -119
- data/spec/spec_tests/data/sdam/rs/wrong_set_name.yml +0 -38
- data/spec/spec_tests/data/sdam/sharded/compatible.yml +0 -40
- data/spec/spec_tests/data/sdam/sharded/discover_single_mongos.yml +0 -24
- data/spec/spec_tests/data/sdam/sharded/ls_timeout_mongos.yml +0 -101
- data/spec/spec_tests/data/sdam/sharded/mongos_disconnect.yml +0 -113
- data/spec/spec_tests/data/sdam/sharded/multiple_mongoses.yml +0 -52
- data/spec/spec_tests/data/sdam/sharded/non_mongos_removed.yml +0 -47
- data/spec/spec_tests/data/sdam/sharded/normalize_uri_case.yml +0 -32
- data/spec/spec_tests/data/sdam/sharded/ruby_primary_different_address.yml +0 -21
- data/spec/spec_tests/data/sdam/sharded/ruby_primary_mismatched_me.yml +0 -22
- data/spec/spec_tests/data/sdam/sharded/too_new.yml +0 -38
- data/spec/spec_tests/data/sdam/sharded/too_old.yml +0 -38
- data/spec/spec_tests/data/sdam/single/compatible.yml +0 -27
- data/spec/spec_tests/data/sdam/single/direct_connection_external_ip.yml +0 -37
- data/spec/spec_tests/data/sdam/single/direct_connection_mongos.yml +0 -36
- data/spec/spec_tests/data/sdam/single/direct_connection_replicaset.yml +0 -23
- data/spec/spec_tests/data/sdam/single/direct_connection_rsarbiter.yml +0 -38
- data/spec/spec_tests/data/sdam/single/direct_connection_rsprimary.yml +0 -37
- data/spec/spec_tests/data/sdam/single/direct_connection_rssecondary.yml +0 -38
- data/spec/spec_tests/data/sdam/single/direct_connection_standalone.yml +0 -35
- data/spec/spec_tests/data/sdam/single/direct_connection_unavailable_seed.yml +0 -28
- data/spec/spec_tests/data/sdam/single/direct_connection_wrong_set_name.yml +0 -40
- data/spec/spec_tests/data/sdam/single/discover_standalone.yml +0 -35
- data/spec/spec_tests/data/sdam/single/discover_unavailable_seed.yml +0 -28
- data/spec/spec_tests/data/sdam/single/ls_timeout_standalone.yml +0 -36
- data/spec/spec_tests/data/sdam/single/not_ok_response.yml +0 -44
- data/spec/spec_tests/data/sdam/single/ruby_primary_different_address.yml +0 -24
- data/spec/spec_tests/data/sdam/single/ruby_primary_mismatched_me.yml +0 -25
- data/spec/spec_tests/data/sdam/single/standalone_removed.yml +0 -35
- data/spec/spec_tests/data/sdam/single/standalone_using_legacy_hello.yml +0 -34
- data/spec/spec_tests/data/sdam/single/too_new.yml +0 -27
- data/spec/spec_tests/data/sdam/single/too_old.yml +0 -25
- data/spec/spec_tests/data/sdam/single/too_old_then_upgraded.yml +0 -48
- data/spec/spec_tests/data/sdam_monitoring/discovered_standalone.yml +0 -70
- data/spec/spec_tests/data/sdam_monitoring/load_balancer.yml +0 -65
- data/spec/spec_tests/data/sdam_monitoring/replica_set_other_chain.yml +0 -222
- data/spec/spec_tests/data/sdam_monitoring/replica_set_other_change.yml +0 -225
- data/spec/spec_tests/data/sdam_monitoring/replica_set_primary_address_change.yml +0 -251
- data/spec/spec_tests/data/sdam_monitoring/replica_set_with_me_mismatch.yml +0 -111
- data/spec/spec_tests/data/sdam_monitoring/replica_set_with_no_primary.yml +0 -112
- data/spec/spec_tests/data/sdam_monitoring/replica_set_with_primary.yml +0 -111
- data/spec/spec_tests/data/sdam_monitoring/replica_set_with_primary_and_secondary.yml +0 -198
- data/spec/spec_tests/data/sdam_monitoring/replica_set_with_primary_removal.yml +0 -175
- data/spec/spec_tests/data/sdam_monitoring/replica_set_with_removal.yml +0 -111
- data/spec/spec_tests/data/sdam_monitoring/replica_set_with_second_seed_removal.yml +0 -106
- data/spec/spec_tests/data/sdam_monitoring/required_replica_set.yml +0 -108
- data/spec/spec_tests/data/sdam_monitoring/standalone.yml +0 -70
- data/spec/spec_tests/data/sdam_monitoring/standalone_repeated.yml +0 -86
- data/spec/spec_tests/data/sdam_monitoring/standalone_suppress_equal_description_changes.yml +0 -73
- data/spec/spec_tests/data/sdam_monitoring/standalone_to_rs_with_me_mismatch.yml +0 -90
- data/spec/spec_tests/data/sdam_unified/auth-error.yml +0 -130
- data/spec/spec_tests/data/sdam_unified/auth-misc-command-error.yml +0 -132
- data/spec/spec_tests/data/sdam_unified/auth-network-error.yml +0 -132
- data/spec/spec_tests/data/sdam_unified/auth-network-timeout-error.yml +0 -138
- data/spec/spec_tests/data/sdam_unified/auth-shutdown-error.yml +0 -133
- data/spec/spec_tests/data/sdam_unified/cancel-server-check.yml +0 -143
- data/spec/spec_tests/data/sdam_unified/connectTimeoutMS.yml +0 -130
- data/spec/spec_tests/data/sdam_unified/find-network-error.yml +0 -135
- data/spec/spec_tests/data/sdam_unified/find-network-timeout-error.yml +0 -119
- data/spec/spec_tests/data/sdam_unified/find-shutdown-error.yml +0 -163
- data/spec/spec_tests/data/sdam_unified/hello-command-error.yml +0 -233
- data/spec/spec_tests/data/sdam_unified/hello-network-error.yml +0 -228
- data/spec/spec_tests/data/sdam_unified/hello-timeout.yml +0 -318
- data/spec/spec_tests/data/sdam_unified/insert-network-error.yml +0 -137
- data/spec/spec_tests/data/sdam_unified/insert-shutdown-error.yml +0 -162
- data/spec/spec_tests/data/sdam_unified/interruptInUse-pool-clear.yml +0 -340
- data/spec/spec_tests/data/sdam_unified/minPoolSize-error.yml +0 -125
- data/spec/spec_tests/data/sdam_unified/pool-cleared-error.yml +0 -239
- data/spec/spec_tests/data/sdam_unified/rediscover-quickly-after-step-down.yml +0 -144
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/loadBalanced-directConnection.yml +0 -14
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/loadBalanced-no-results.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/loadBalanced-replicaSet-errors.yml +0 -6
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/loadBalanced-true-multiple-hosts.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/loadBalanced-true-txt.yml +0 -11
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/srvMaxHosts-conflicts_with_loadBalanced-true-txt.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/srvMaxHosts-conflicts_with_loadBalanced-true.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/srvMaxHosts-zero-txt.yml +0 -11
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/srvMaxHosts-zero.yml +0 -11
- data/spec/spec_tests/data/seed_list_discovery/replica-set/direct-connection-false.yml +0 -10
- data/spec/spec_tests/data/seed_list_discovery/replica-set/direct-connection-true.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/encoded-userinfo-and-db.yml +0 -15
- data/spec/spec_tests/data/seed_list_discovery/replica-set/loadBalanced-false-txt.yml +0 -10
- data/spec/spec_tests/data/seed_list_discovery/replica-set/longer-parent-in-return.yml +0 -11
- data/spec/spec_tests/data/seed_list_discovery/replica-set/misformatted-option.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/no-results.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/not-enough-parts.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/one-result-default-port.yml +0 -10
- data/spec/spec_tests/data/seed_list_discovery/replica-set/one-txt-record-multiple-strings.yml +0 -10
- data/spec/spec_tests/data/seed_list_discovery/replica-set/one-txt-record.yml +0 -11
- data/spec/spec_tests/data/seed_list_discovery/replica-set/parent-part-mismatch1.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/parent-part-mismatch2.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/parent-part-mismatch3.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/parent-part-mismatch4.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/parent-part-mismatch5.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/returned-parent-too-short.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/returned-parent-wrong.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/srv-service-name.yml +0 -11
- data/spec/spec_tests/data/seed_list_discovery/replica-set/srvMaxHosts-conflicts_with_replicaSet-txt.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/srvMaxHosts-conflicts_with_replicaSet.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/srvMaxHosts-equal_to_srv_records.yml +0 -16
- data/spec/spec_tests/data/seed_list_discovery/replica-set/srvMaxHosts-greater_than_srv_records.yml +0 -15
- data/spec/spec_tests/data/seed_list_discovery/replica-set/srvMaxHosts-less_than_srv_records.yml +0 -15
- data/spec/spec_tests/data/seed_list_discovery/replica-set/srvMaxHosts-zero-txt.yml +0 -15
- data/spec/spec_tests/data/seed_list_discovery/replica-set/srvMaxHosts-zero.yml +0 -15
- data/spec/spec_tests/data/seed_list_discovery/replica-set/two-results-default-port.yml +0 -11
- data/spec/spec_tests/data/seed_list_discovery/replica-set/two-results-nonstandard-port.yml +0 -11
- data/spec/spec_tests/data/seed_list_discovery/replica-set/two-txt-records.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/txt-record-not-allowed-option.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/txt-record-with-overridden-ssl-option.yml +0 -11
- data/spec/spec_tests/data/seed_list_discovery/replica-set/txt-record-with-overridden-uri-option.yml +0 -11
- data/spec/spec_tests/data/seed_list_discovery/replica-set/txt-record-with-unallowed-option.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/uri-with-admin-database.yml +0 -13
- data/spec/spec_tests/data/seed_list_discovery/replica-set/uri-with-auth.yml +0 -12
- data/spec/spec_tests/data/seed_list_discovery/replica-set/uri-with-port.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/replica-set/uri-with-two-hosts.yml +0 -5
- data/spec/spec_tests/data/seed_list_discovery/sharded/srvMaxHosts-equal_to_srv_records.yml +0 -13
- data/spec/spec_tests/data/seed_list_discovery/sharded/srvMaxHosts-greater_than_srv_records.yml +0 -12
- data/spec/spec_tests/data/seed_list_discovery/sharded/srvMaxHosts-less_than_srv_records.yml +0 -10
- data/spec/spec_tests/data/seed_list_discovery/sharded/srvMaxHosts-zero.yml +0 -11
- data/spec/spec_tests/data/server_selection/ReplicaSetNoPrimary/read/Nearest.yml +0 -25
- data/spec/spec_tests/data/server_selection/ReplicaSetNoPrimary/read/Nearest_multiple.yml +0 -26
- data/spec/spec_tests/data/server_selection/ReplicaSetNoPrimary/read/Nearest_non_matching.yml +0 -20
- data/spec/spec_tests/data/server_selection/ReplicaSetNoPrimary/read/PossiblePrimary.yml +0 -15
- data/spec/spec_tests/data/server_selection/ReplicaSetNoPrimary/read/PossiblePrimaryNearest.yml +0 -15
- data/spec/spec_tests/data/server_selection/ReplicaSetNoPrimary/read/Primary.yml +0 -18
- data/spec/spec_tests/data/server_selection/ReplicaSetNoPrimary/read/PrimaryPreferred.yml +0 -25
- data/spec/spec_tests/data/server_selection/ReplicaSetNoPrimary/read/PrimaryPreferred_non_matching.yml +0 -20
- data/spec/spec_tests/data/server_selection/ReplicaSetNoPrimary/read/Secondary.yml +0 -25
- data/spec/spec_tests/data/server_selection/ReplicaSetNoPrimary/read/SecondaryPreferred.yml +0 -25
- data/spec/spec_tests/data/server_selection/ReplicaSetNoPrimary/read/SecondaryPreferred_non_matching.yml +0 -20
- data/spec/spec_tests/data/server_selection/ReplicaSetNoPrimary/read/Secondary_multi_tags.yml +0 -31
- data/spec/spec_tests/data/server_selection/ReplicaSetNoPrimary/read/Secondary_multi_tags2.yml +0 -31
- data/spec/spec_tests/data/server_selection/ReplicaSetNoPrimary/read/Secondary_non_matching.yml +0 -20
- data/spec/spec_tests/data/server_selection/ReplicaSetWithPrimary/read/Nearest.yml +0 -32
- data/spec/spec_tests/data/server_selection/ReplicaSetWithPrimary/read/Nearest_multiple.yml +0 -33
- data/spec/spec_tests/data/server_selection/ReplicaSetWithPrimary/read/Nearest_non_matching.yml +0 -25
- data/spec/spec_tests/data/server_selection/ReplicaSetWithPrimary/read/Primary.yml +0 -26
- data/spec/spec_tests/data/server_selection/ReplicaSetWithPrimary/read/PrimaryPreferred.yml +0 -28
- data/spec/spec_tests/data/server_selection/ReplicaSetWithPrimary/read/PrimaryPreferred_non_matching.yml +0 -28
- data/spec/spec_tests/data/server_selection/ReplicaSetWithPrimary/read/Secondary.yml +0 -30
- data/spec/spec_tests/data/server_selection/ReplicaSetWithPrimary/read/SecondaryPreferred.yml +0 -30
- data/spec/spec_tests/data/server_selection/ReplicaSetWithPrimary/read/SecondaryPreferred_non_matching.yml +0 -28
- data/spec/spec_tests/data/server_selection/ReplicaSetWithPrimary/read/SecondaryPreferred_tags.yml +0 -28
- data/spec/spec_tests/data/server_selection/ReplicaSetWithPrimary/read/Secondary_non_matching.yml +0 -25
- data/spec/spec_tests/data/server_selection/Sharded/read/Nearest.yml +0 -21
- data/spec/spec_tests/data/server_selection/Sharded/read/Primary.yml +0 -19
- data/spec/spec_tests/data/server_selection/Sharded/read/PrimaryPreferred.yml +0 -21
- data/spec/spec_tests/data/server_selection/Sharded/read/Secondary.yml +0 -21
- data/spec/spec_tests/data/server_selection/Sharded/read/SecondaryPreferred.yml +0 -21
- data/spec/spec_tests/data/server_selection/Single/read/SecondaryPreferred.yml +0 -18
- data/spec/spec_tests/data/server_selection/Unknown/read/SecondaryPreferred.yml +0 -10
- data/spec/spec_tests/data/server_selection/Unknown/read/ghost.yml +0 -11
- data/spec/spec_tests/data/server_selection/Unknown/write/ghost.yml +0 -11
- data/spec/spec_tests/data/server_selection_rtt/first_value.yml +0 -4
- data/spec/spec_tests/data/server_selection_rtt/first_value_zero.yml +0 -4
- data/spec/spec_tests/data/server_selection_rtt/value_test_1.yml +0 -4
- data/spec/spec_tests/data/server_selection_rtt/value_test_2.yml +0 -4
- data/spec/spec_tests/data/server_selection_rtt/value_test_3.yml +0 -4
- data/spec/spec_tests/data/server_selection_rtt/value_test_4.yml +0 -4
- data/spec/spec_tests/data/server_selection_rtt/value_test_5.yml +0 -4
- data/spec/spec_tests/data/sessions_unified/driver-sessions-dirty-session-errors.yml +0 -351
- data/spec/spec_tests/data/sessions_unified/driver-sessions-server-support.yml +0 -123
- data/spec/spec_tests/data/sessions_unified/implicit-sessions-default-causal-consistency.yml +0 -119
- data/spec/spec_tests/data/sessions_unified/snapshot-sessions-not-supported-client-error.yml +0 -75
- data/spec/spec_tests/data/sessions_unified/snapshot-sessions-not-supported-server-error.yml +0 -102
- data/spec/spec_tests/data/sessions_unified/snapshot-sessions-unsupported-ops.yml +0 -258
- data/spec/spec_tests/data/sessions_unified/snapshot-sessions.yml +0 -482
- data/spec/spec_tests/data/transactions/abort.yml +0 -413
- data/spec/spec_tests/data/transactions/bulk.yml +0 -267
- data/spec/spec_tests/data/transactions/causal-consistency.yml +0 -175
- data/spec/spec_tests/data/transactions/commit.yml +0 -603
- data/spec/spec_tests/data/transactions/count.yml +0 -67
- data/spec/spec_tests/data/transactions/create-collection.yml +0 -131
- data/spec/spec_tests/data/transactions/create-index.yml +0 -152
- data/spec/spec_tests/data/transactions/delete.yml +0 -192
- data/spec/spec_tests/data/transactions/error-labels.yml +0 -1030
- data/spec/spec_tests/data/transactions/errors-client.yml +0 -55
- data/spec/spec_tests/data/transactions/errors.yml +0 -133
- data/spec/spec_tests/data/transactions/findOneAndDelete.yml +0 -134
- data/spec/spec_tests/data/transactions/findOneAndReplace.yml +0 -148
- data/spec/spec_tests/data/transactions/findOneAndUpdate.yml +0 -236
- data/spec/spec_tests/data/transactions/insert.yml +0 -390
- data/spec/spec_tests/data/transactions/isolation.yml +0 -133
- data/spec/spec_tests/data/transactions/mongos-pin-auto.yml +0 -1674
- data/spec/spec_tests/data/transactions/mongos-recovery-token.yml +0 -350
- data/spec/spec_tests/data/transactions/pin-mongos.yml +0 -559
- data/spec/spec_tests/data/transactions/read-concern.yml +0 -623
- data/spec/spec_tests/data/transactions/read-pref.yml +0 -348
- data/spec/spec_tests/data/transactions/reads.yml +0 -261
- data/spec/spec_tests/data/transactions/retryable-abort-errorLabels.yml +0 -124
- data/spec/spec_tests/data/transactions/retryable-abort.yml +0 -1315
- data/spec/spec_tests/data/transactions/retryable-commit-errorLabels.yml +0 -132
- data/spec/spec_tests/data/transactions/retryable-commit.yml +0 -1460
- data/spec/spec_tests/data/transactions/retryable-writes.yml +0 -216
- data/spec/spec_tests/data/transactions/run-command.yml +0 -197
- data/spec/spec_tests/data/transactions/transaction-options-repl.yml +0 -117
- data/spec/spec_tests/data/transactions/transaction-options.yml +0 -781
- data/spec/spec_tests/data/transactions/update.yml +0 -246
- data/spec/spec_tests/data/transactions/write-concern.yml +0 -554
- data/spec/spec_tests/data/transactions_api/callback-aborts.yml +0 -170
- data/spec/spec_tests/data/transactions_api/callback-commits.yml +0 -204
- data/spec/spec_tests/data/transactions_api/callback-retry.yml +0 -215
- data/spec/spec_tests/data/transactions_api/commit-retry.yml +0 -324
- data/spec/spec_tests/data/transactions_api/commit-transienttransactionerror-4.2.yml +0 -139
- data/spec/spec_tests/data/transactions_api/commit-transienttransactionerror.yml +0 -175
- data/spec/spec_tests/data/transactions_api/commit-writeconcernerror.yml +0 -216
- data/spec/spec_tests/data/transactions_api/commit.yml +0 -193
- data/spec/spec_tests/data/transactions_api/transaction-options.yml +0 -274
- data/spec/spec_tests/data/transactions_unified/do-not-retry-read-in-transaction.yml +0 -64
- data/spec/spec_tests/data/transactions_unified/mongos-unpin.yml +0 -172
- data/spec/spec_tests/data/transactions_unified/retryable-abort-handshake.yml +0 -118
- data/spec/spec_tests/data/transactions_unified/retryable-commit-handshake.yml +0 -118
- data/spec/spec_tests/data/unified/valid-fail/entity-findCursor-malformed.yml +0 -31
- data/spec/spec_tests/data/unified/valid-fail/entity-findCursor.yml +0 -31
- data/spec/spec_tests/data/unified/valid-fail/ignoreResultAndError-malformed.yml +0 -34
- data/spec/spec_tests/data/unified/valid-fail/ignoreResultAndError.yml +0 -35
- data/spec/spec_tests/data/unified/valid-fail/operation-failure.yml +0 -31
- data/spec/spec_tests/data/unified/valid-fail/operation-unsupported.yml +0 -13
- data/spec/spec_tests/data/unified/valid-pass/assertNumberConnectionsCheckedOut.yml +0 -17
- data/spec/spec_tests/data/unified/valid-pass/collectionData-createOptions.yml +0 -37
- data/spec/spec_tests/data/unified/valid-pass/entity-client-cmap-events.yml +0 -40
- data/spec/spec_tests/data/unified/valid-pass/entity-client-storeEventsAsEntities.yml +0 -37
- data/spec/spec_tests/data/unified/valid-pass/expectedError-errorResponse.yml +0 -39
- data/spec/spec_tests/data/unified/valid-pass/expectedEventsForClient-eventType.yml +0 -66
- data/spec/spec_tests/data/unified/valid-pass/expectedEventsForClient-ignoreExtraEvents.yml +0 -78
- data/spec/spec_tests/data/unified/valid-pass/ignoreResultAndError.yml +0 -34
- data/spec/spec_tests/data/unified/valid-pass/observeSensitiveCommands.yml +0 -255
- data/spec/spec_tests/data/unified/valid-pass/poc-change-streams.yml +0 -241
- data/spec/spec_tests/data/unified/valid-pass/poc-command-monitoring.yml +0 -102
- data/spec/spec_tests/data/unified/valid-pass/poc-crud.yml +0 -190
- data/spec/spec_tests/data/unified/valid-pass/poc-gridfs.yml +0 -155
- data/spec/spec_tests/data/unified/valid-pass/poc-retryable-reads.yml +0 -193
- data/spec/spec_tests/data/unified/valid-pass/poc-retryable-writes.yml +0 -210
- data/spec/spec_tests/data/unified/valid-pass/poc-sessions.yml +0 -214
- data/spec/spec_tests/data/unified/valid-pass/poc-transactions-convenient-api.yml +0 -235
- data/spec/spec_tests/data/unified/valid-pass/poc-transactions-mongos-pin-auto.yml +0 -169
- data/spec/spec_tests/data/unified/valid-pass/poc-transactions.yml +0 -171
- data/spec/spec_tests/data/uri_options/auth-options.yml +0 -49
- data/spec/spec_tests/data/uri_options/compression-options.yml +0 -51
- data/spec/spec_tests/data/uri_options/concern-options.yml +0 -55
- data/spec/spec_tests/data/uri_options/connection-options.yml +0 -209
- data/spec/spec_tests/data/uri_options/connection-pool-options.yml +0 -26
- data/spec/spec_tests/data/uri_options/read-preference-options.yml +0 -66
- data/spec/spec_tests/data/uri_options/ruby-auth-options.yml +0 -12
- data/spec/spec_tests/data/uri_options/ruby-connection-options.yml +0 -58
- data/spec/spec_tests/data/uri_options/srv-options.yml +0 -96
- data/spec/spec_tests/data/uri_options/tls-options.yml +0 -364
- data/spec/spec_tests/data/versioned_api/crud-api-version-1-strict.yml +0 -419
- data/spec/spec_tests/data/versioned_api/crud-api-version-1.yml +0 -413
- data/spec/spec_tests/data/versioned_api/runcommand-helper-no-api-version-declared.yml +0 -75
- data/spec/spec_tests/data/versioned_api/test-commands-deprecation-errors.yml +0 -47
- data/spec/spec_tests/data/versioned_api/test-commands-strict-mode.yml +0 -46
- data/spec/spec_tests/data/versioned_api/transaction-handling.yml +0 -128
- data/spec/spec_tests/gridfs_spec.rb +0 -55
- data/spec/spec_tests/gridfs_unified_spec.rb +0 -13
- data/spec/spec_tests/index_management_unified_spec.rb +0 -13
- data/spec/spec_tests/load_balancers_spec.rb +0 -15
- data/spec/spec_tests/max_staleness_spec.rb +0 -12
- data/spec/spec_tests/read_write_concern_connection_string_spec.rb +0 -13
- data/spec/spec_tests/read_write_concern_document_spec.rb +0 -77
- data/spec/spec_tests/read_write_concern_operaton_spec.rb +0 -13
- data/spec/spec_tests/retryable_reads_spec.rb +0 -55
- data/spec/spec_tests/retryable_reads_unified_spec.rb +0 -22
- data/spec/spec_tests/retryable_writes_spec.rb +0 -25
- data/spec/spec_tests/retryable_writes_unified_spec.rb +0 -21
- data/spec/spec_tests/run_command_unified_spec.rb +0 -13
- data/spec/spec_tests/sdam_monitoring_spec.rb +0 -101
- data/spec/spec_tests/sdam_spec.rb +0 -246
- data/spec/spec_tests/sdam_unified_spec.rb +0 -15
- data/spec/spec_tests/seed_list_discovery_spec.rb +0 -127
- data/spec/spec_tests/server_selection_rtt_spec.rb +0 -33
- data/spec/spec_tests/server_selection_spec.rb +0 -12
- data/spec/spec_tests/sessions_unified_spec.rb +0 -13
- data/spec/spec_tests/transactions_api_spec.rb +0 -13
- data/spec/spec_tests/transactions_spec.rb +0 -13
- data/spec/spec_tests/transactions_unified_spec.rb +0 -14
- data/spec/spec_tests/unified_spec.rb +0 -18
- data/spec/spec_tests/uri_options_spec.rb +0 -93
- data/spec/spec_tests/versioned_api_spec.rb +0 -13
- data/spec/stress/cleanup_spec.rb +0 -61
- data/spec/stress/connection_pool_stress_spec.rb +0 -143
- data/spec/stress/connection_pool_timing_spec.rb +0 -160
- data/spec/stress/fork_reconnect_stress_spec.rb +0 -108
- data/spec/stress/push_monitor_close_spec.rb +0 -44
- data/spec/support/authorization.rb +0 -161
- data/spec/support/aws_utils/base.rb +0 -137
- data/spec/support/aws_utils/inspector.rb +0 -227
- data/spec/support/aws_utils/orchestrator.rb +0 -385
- data/spec/support/aws_utils/provisioner.rb +0 -363
- data/spec/support/aws_utils.rb +0 -66
- data/spec/support/background_thread_registry.rb +0 -60
- data/spec/support/certificates/README.md +0 -106
- data/spec/support/certificates/atlas-ocsp-ca.crt +0 -113
- data/spec/support/certificates/atlas-ocsp.crt +0 -147
- data/spec/support/certificates/ca.crt +0 -76
- data/spec/support/certificates/client-encrypted.key +0 -30
- data/spec/support/certificates/client-int.crt +0 -78
- data/spec/support/certificates/client-second-level-bundle.pem +0 -179
- data/spec/support/certificates/client-second-level.crt +0 -74
- data/spec/support/certificates/client-second-level.key +0 -27
- data/spec/support/certificates/client-second-level.pem +0 -101
- data/spec/support/certificates/client-x509.crt +0 -78
- data/spec/support/certificates/client-x509.key +0 -27
- data/spec/support/certificates/client-x509.pem +0 -105
- data/spec/support/certificates/client.crt +0 -74
- data/spec/support/certificates/client.key +0 -27
- data/spec/support/certificates/client.pem +0 -101
- data/spec/support/certificates/crl.pem +0 -12
- data/spec/support/certificates/crl_client_revoked.pem +0 -13
- data/spec/support/certificates/multi-ca.crt +0 -152
- data/spec/support/certificates/python-ca.crt +0 -76
- data/spec/support/certificates/retrieve-atlas-cert +0 -40
- data/spec/support/certificates/server-int.crt +0 -78
- data/spec/support/certificates/server-second-level-bundle.pem +0 -179
- data/spec/support/certificates/server-second-level.crt +0 -74
- data/spec/support/certificates/server-second-level.key +0 -27
- data/spec/support/certificates/server-second-level.pem +0 -101
- data/spec/support/certificates/server.pem +0 -101
- data/spec/support/client_registry.rb +0 -258
- data/spec/support/client_registry_macros.rb +0 -26
- data/spec/support/cluster_tools.rb +0 -384
- data/spec/support/common_shortcuts.rb +0 -421
- data/spec/support/constraints.rb +0 -39
- data/spec/support/crypt/corpus/corpus-encrypted.json +0 -9515
- data/spec/support/crypt/corpus/corpus-key-aws.json +0 -33
- data/spec/support/crypt/corpus/corpus-key-azure.json +0 -33
- data/spec/support/crypt/corpus/corpus-key-gcp.json +0 -35
- data/spec/support/crypt/corpus/corpus-key-kmip.json +0 -32
- data/spec/support/crypt/corpus/corpus-key-local.json +0 -31
- data/spec/support/crypt/corpus/corpus-schema.json +0 -6335
- data/spec/support/crypt/corpus/corpus.json +0 -8619
- data/spec/support/crypt/data_keys/key_document_aws.json +0 -34
- data/spec/support/crypt/data_keys/key_document_azure.json +0 -33
- data/spec/support/crypt/data_keys/key_document_gcp.json +0 -37
- data/spec/support/crypt/data_keys/key_document_kmip.json +0 -32
- data/spec/support/crypt/data_keys/key_document_local.json +0 -31
- data/spec/support/crypt/encrypted_fields/encryptedFields.json +0 -32
- data/spec/support/crypt/encrypted_fields/range-encryptedFields-Date.json +0 -30
- data/spec/support/crypt/encrypted_fields/range-encryptedFields-DecimalNoPrecision.json +0 -21
- data/spec/support/crypt/encrypted_fields/range-encryptedFields-DecimalPrecision.json +0 -29
- data/spec/support/crypt/encrypted_fields/range-encryptedFields-DoubleNoPrecision.json +0 -21
- data/spec/support/crypt/encrypted_fields/range-encryptedFields-DoublePrecision.json +0 -30
- data/spec/support/crypt/encrypted_fields/range-encryptedFields-Int.json +0 -27
- data/spec/support/crypt/encrypted_fields/range-encryptedFields-Long.json +0 -27
- data/spec/support/crypt/external/external-key.json +0 -31
- data/spec/support/crypt/external/external-schema.json +0 -19
- data/spec/support/crypt/keys/key1-document.json +0 -30
- data/spec/support/crypt/limits/limits-doc.json +0 -102
- data/spec/support/crypt/limits/limits-key.json +0 -31
- data/spec/support/crypt/limits/limits-schema.json +0 -1405
- data/spec/support/crypt/schema_maps/schema_map_aws.json +0 -17
- data/spec/support/crypt/schema_maps/schema_map_aws_key_alt_names.json +0 -12
- data/spec/support/crypt/schema_maps/schema_map_azure.json +0 -17
- data/spec/support/crypt/schema_maps/schema_map_azure_key_alt_names.json +0 -12
- data/spec/support/crypt/schema_maps/schema_map_gcp.json +0 -17
- data/spec/support/crypt/schema_maps/schema_map_gcp_key_alt_names.json +0 -12
- data/spec/support/crypt/schema_maps/schema_map_kmip.json +0 -17
- data/spec/support/crypt/schema_maps/schema_map_kmip_key_alt_names.json +0 -12
- data/spec/support/crypt/schema_maps/schema_map_local.json +0 -18
- data/spec/support/crypt/schema_maps/schema_map_local_key_alt_names.json +0 -12
- data/spec/support/crypt.rb +0 -412
- data/spec/support/dns.rb +0 -16
- data/spec/support/json_ext_formatter.rb +0 -16
- data/spec/support/keyword_struct.rb +0 -29
- data/spec/support/local_resource_registry.rb +0 -37
- data/spec/support/macros.rb +0 -29
- data/spec/support/matchers.rb +0 -88
- data/spec/support/mongos_macros.rb +0 -24
- data/spec/support/monitoring_ext.rb +0 -19
- data/spec/support/ocsp +0 -1
- data/spec/support/primary_socket.rb +0 -24
- data/spec/support/recording_logger.rb +0 -27
- data/spec/support/sdam_formatter_integration.rb +0 -119
- data/spec/support/shared/app_metadata.rb +0 -179
- data/spec/support/shared/auth_context.rb +0 -17
- data/spec/support/shared/protocol.rb +0 -36
- data/spec/support/shared/scram_conversation.rb +0 -104
- data/spec/support/shared/server_selector.rb +0 -233
- data/spec/support/shared/session.rb +0 -916
- data/spec/support/spec_config.rb +0 -767
- data/spec/support/spec_setup.rb +0 -83
- data/spec/support/using_hash.rb +0 -40
- data/spec/support/utils.rb +0 -680
@@ -1,2283 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
# rubocop:todo all
|
3
|
-
|
4
|
-
require 'spec_helper'
|
5
|
-
|
6
|
-
describe Mongo::Collection::View::Readable do
|
7
|
-
|
8
|
-
let(:selector) do
|
9
|
-
{}
|
10
|
-
end
|
11
|
-
|
12
|
-
let(:options) do
|
13
|
-
{}
|
14
|
-
end
|
15
|
-
|
16
|
-
let(:view) do
|
17
|
-
Mongo::Collection::View.new(authorized_collection, selector, options)
|
18
|
-
end
|
19
|
-
|
20
|
-
before do
|
21
|
-
authorized_collection.delete_many
|
22
|
-
end
|
23
|
-
|
24
|
-
shared_examples_for 'a read concern aware operation' do
|
25
|
-
|
26
|
-
context 'when a read concern is provided' do
|
27
|
-
min_server_fcv '3.2'
|
28
|
-
|
29
|
-
let(:new_view) do
|
30
|
-
Mongo::Collection::View.new(new_collection, selector, options)
|
31
|
-
end
|
32
|
-
|
33
|
-
context 'when the read concern is valid' do
|
34
|
-
|
35
|
-
let(:new_collection) do
|
36
|
-
authorized_collection.with(read_concern: { level: 'local' })
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'sends the read concern' do
|
40
|
-
expect { result }.to_not raise_error
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
context 'when the read concern is not valid' do
|
45
|
-
|
46
|
-
let(:new_collection) do
|
47
|
-
authorized_collection.with(read_concern: { level: 'na' })
|
48
|
-
end
|
49
|
-
|
50
|
-
it 'raises an exception' do
|
51
|
-
expect {
|
52
|
-
result
|
53
|
-
}.to raise_error(Mongo::Error::OperationFailure)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
describe '#allow_partial_results' do
|
60
|
-
|
61
|
-
let(:new_view) do
|
62
|
-
view.allow_partial_results
|
63
|
-
end
|
64
|
-
|
65
|
-
it 'sets the flag' do
|
66
|
-
expect(new_view.options[:allow_partial_results]).to be true
|
67
|
-
end
|
68
|
-
|
69
|
-
it 'returns a new View' do
|
70
|
-
expect(new_view).not_to be(view)
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
describe '#allow_disk_use' do
|
75
|
-
let(:new_view) do
|
76
|
-
view.allow_disk_use
|
77
|
-
end
|
78
|
-
|
79
|
-
it 'sets the flag' do
|
80
|
-
expect(new_view.options[:allow_disk_use]).to be true
|
81
|
-
end
|
82
|
-
|
83
|
-
it 'returns the new View' do
|
84
|
-
expect(new_view).not_to be(view)
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
describe '#aggregate' do
|
89
|
-
|
90
|
-
let(:documents) do
|
91
|
-
[
|
92
|
-
{ city: "Berlin", pop: 18913, neighborhood: "Kreuzberg" },
|
93
|
-
{ city: "Berlin", pop: 84143, neighborhood: "Mitte" },
|
94
|
-
{ city: "New York", pop: 40270, neighborhood: "Brooklyn" }
|
95
|
-
]
|
96
|
-
end
|
97
|
-
|
98
|
-
let(:pipeline) do
|
99
|
-
[{
|
100
|
-
"$group" => {
|
101
|
-
"_id" => "$city",
|
102
|
-
"totalpop" => { "$sum" => "$pop" }
|
103
|
-
}
|
104
|
-
}]
|
105
|
-
end
|
106
|
-
|
107
|
-
before do
|
108
|
-
authorized_collection.insert_many(documents)
|
109
|
-
end
|
110
|
-
|
111
|
-
let(:aggregation) do
|
112
|
-
view.aggregate(pipeline)
|
113
|
-
end
|
114
|
-
|
115
|
-
context 'when incorporating read concern' do
|
116
|
-
|
117
|
-
let(:result) do
|
118
|
-
new_view.aggregate(pipeline, options).to_a
|
119
|
-
end
|
120
|
-
|
121
|
-
it_behaves_like 'a read concern aware operation'
|
122
|
-
end
|
123
|
-
|
124
|
-
context 'when not iterating the aggregation' do
|
125
|
-
|
126
|
-
it 'returns the aggregation object' do
|
127
|
-
expect(aggregation).to be_a(Mongo::Collection::View::Aggregation)
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
|
-
context 'when iterating the aggregation' do
|
132
|
-
|
133
|
-
it 'yields to each document' do
|
134
|
-
aggregation.each do |doc|
|
135
|
-
expect(doc[:totalpop]).to_not be_nil
|
136
|
-
end
|
137
|
-
end
|
138
|
-
end
|
139
|
-
|
140
|
-
context 'when options are specified' do
|
141
|
-
|
142
|
-
let(:agg_options) do
|
143
|
-
{ :max_time_ms => 500 }
|
144
|
-
end
|
145
|
-
|
146
|
-
let(:aggregation) do
|
147
|
-
view.aggregate(pipeline, agg_options)
|
148
|
-
end
|
149
|
-
|
150
|
-
it 'passes the option to the Aggregation object' do
|
151
|
-
expect(aggregation.options[:max_time_ms]).to eq(agg_options[:max_time_ms])
|
152
|
-
end
|
153
|
-
end
|
154
|
-
|
155
|
-
context "when using methods to set aggregate options" do
|
156
|
-
|
157
|
-
context "when the broken_view_options flag is off" do
|
158
|
-
config_override :broken_view_options, false
|
159
|
-
|
160
|
-
let(:aggregate) do
|
161
|
-
view.send(opt, param).aggregate(pipeline, options)
|
162
|
-
end
|
163
|
-
|
164
|
-
context "when a :allow_disk_use is given" do
|
165
|
-
let(:aggregate) do
|
166
|
-
view.allow_disk_use.aggregate(pipeline, options)
|
167
|
-
end
|
168
|
-
let(:opt) { :allow_disk_use }
|
169
|
-
|
170
|
-
it "sets the option correctly" do
|
171
|
-
expect(aggregate.options[opt]).to eq(true)
|
172
|
-
end
|
173
|
-
end
|
174
|
-
|
175
|
-
context "when a :batch_size is given" do
|
176
|
-
let(:opt) { :batch_size }
|
177
|
-
let(:param) { 2 }
|
178
|
-
|
179
|
-
it "sets the option correctly" do
|
180
|
-
expect(aggregate.options[opt]).to eq(param)
|
181
|
-
end
|
182
|
-
end
|
183
|
-
|
184
|
-
context "when a :max_time_ms is given" do
|
185
|
-
let(:opt) { :max_time_ms }
|
186
|
-
let(:param) { 2 }
|
187
|
-
|
188
|
-
it "sets the option correctly" do
|
189
|
-
expect(aggregate.options[opt]).to eq(param)
|
190
|
-
end
|
191
|
-
end
|
192
|
-
|
193
|
-
context "when a :max_await_time_ms is given" do
|
194
|
-
let(:opt) { :max_await_time_ms }
|
195
|
-
let(:param) { 2 }
|
196
|
-
|
197
|
-
it "sets the option correctly" do
|
198
|
-
expect(aggregate.options[opt]).to eq(param)
|
199
|
-
end
|
200
|
-
end
|
201
|
-
|
202
|
-
context "when a :comment is given" do
|
203
|
-
let(:opt) { :comment }
|
204
|
-
let(:param) { "comment" }
|
205
|
-
|
206
|
-
it "sets the option correctly" do
|
207
|
-
expect(aggregate.options[opt]).to eq(param)
|
208
|
-
end
|
209
|
-
end
|
210
|
-
|
211
|
-
context "when a :hint is given" do
|
212
|
-
let(:opt) { :hint }
|
213
|
-
let(:param) { "_id_" }
|
214
|
-
|
215
|
-
it "sets the option correctly" do
|
216
|
-
expect(aggregate.options[opt]).to eq(param)
|
217
|
-
end
|
218
|
-
end
|
219
|
-
|
220
|
-
context "when a :session is given on the view" do
|
221
|
-
let(:opt) { :session }
|
222
|
-
let(:param) { authorized_client.start_session }
|
223
|
-
let(:aggregate) do
|
224
|
-
authorized_collection.find({}, session: param).aggregate(pipeline, options)
|
225
|
-
end
|
226
|
-
|
227
|
-
after do
|
228
|
-
param.end_session
|
229
|
-
end
|
230
|
-
|
231
|
-
context "when broken_view_options is false" do
|
232
|
-
config_override :broken_view_options, false
|
233
|
-
|
234
|
-
it "sets the option correctly" do
|
235
|
-
expect(aggregate.options[opt]).to eq(param)
|
236
|
-
end
|
237
|
-
end
|
238
|
-
|
239
|
-
context "when broken_view_options is true" do
|
240
|
-
config_override :broken_view_options, true
|
241
|
-
|
242
|
-
it "does not set the option" do
|
243
|
-
expect(aggregate.options[opt]).to be nil
|
244
|
-
end
|
245
|
-
end
|
246
|
-
end
|
247
|
-
|
248
|
-
context "when also including in options" do
|
249
|
-
|
250
|
-
let(:aggregate) do
|
251
|
-
view.limit(1).aggregate(pipeline, { limit: 2 })
|
252
|
-
end
|
253
|
-
|
254
|
-
it "sets the option correctly" do
|
255
|
-
expect(aggregate.options[:limit]).to eq(2)
|
256
|
-
end
|
257
|
-
end
|
258
|
-
end
|
259
|
-
|
260
|
-
context "when the broken_view_options flag is on" do
|
261
|
-
config_override :broken_view_options, true
|
262
|
-
|
263
|
-
let(:aggregate) do
|
264
|
-
view.send(opt, param).aggregate(pipeline, options)
|
265
|
-
end
|
266
|
-
|
267
|
-
context "when a :allow_disk_use is given" do
|
268
|
-
let(:aggregate) do
|
269
|
-
view.allow_disk_use.aggregate(pipeline, options)
|
270
|
-
end
|
271
|
-
let(:opt) { :allow_disk_use }
|
272
|
-
|
273
|
-
it "doesn't set the option correctly" do
|
274
|
-
expect(aggregate.options[opt]).to be_nil
|
275
|
-
end
|
276
|
-
end
|
277
|
-
|
278
|
-
context "when a :batch_size is given" do
|
279
|
-
let(:opt) { :batch_size }
|
280
|
-
let(:param) { 2 }
|
281
|
-
|
282
|
-
it "doesn't set the option correctly" do
|
283
|
-
expect(aggregate.options[opt]).to be_nil
|
284
|
-
end
|
285
|
-
end
|
286
|
-
|
287
|
-
context "when a :max_time_ms is given" do
|
288
|
-
let(:opt) { :max_time_ms }
|
289
|
-
let(:param) { 2 }
|
290
|
-
|
291
|
-
it "doesn't set the option correctly" do
|
292
|
-
expect(aggregate.options[opt]).to be_nil
|
293
|
-
end
|
294
|
-
end
|
295
|
-
|
296
|
-
context "when a :max_await_time_ms is given" do
|
297
|
-
let(:opt) { :max_await_time_ms }
|
298
|
-
let(:param) { 2 }
|
299
|
-
|
300
|
-
it "doesn't set the option correctly" do
|
301
|
-
expect(aggregate.options[opt]).to be_nil
|
302
|
-
end
|
303
|
-
end
|
304
|
-
|
305
|
-
context "when a :comment is given" do
|
306
|
-
let(:opt) { :comment }
|
307
|
-
let(:param) { "comment" }
|
308
|
-
|
309
|
-
it "doesn't set the option correctly" do
|
310
|
-
expect(aggregate.options[opt]).to be_nil
|
311
|
-
end
|
312
|
-
end
|
313
|
-
|
314
|
-
context "when a :hint is given" do
|
315
|
-
let(:opt) { :hint }
|
316
|
-
let(:param) { "_id_" }
|
317
|
-
|
318
|
-
it "doesn't set the option correctly" do
|
319
|
-
expect(aggregate.options[opt]).to be_nil
|
320
|
-
end
|
321
|
-
end
|
322
|
-
|
323
|
-
context "when also including in options" do
|
324
|
-
|
325
|
-
let(:aggregate) do
|
326
|
-
view.limit(1).aggregate(pipeline, { limit: 2 })
|
327
|
-
end
|
328
|
-
|
329
|
-
it "sets the option correctly" do
|
330
|
-
expect(aggregate.options[:limit]).to eq(2)
|
331
|
-
end
|
332
|
-
end
|
333
|
-
end
|
334
|
-
end
|
335
|
-
end
|
336
|
-
|
337
|
-
describe '#map_reduce' do
|
338
|
-
|
339
|
-
let(:map) do
|
340
|
-
%Q{
|
341
|
-
function() {
|
342
|
-
emit(this.name, { population: this.population });
|
343
|
-
}}
|
344
|
-
end
|
345
|
-
|
346
|
-
let(:reduce) do
|
347
|
-
%Q{
|
348
|
-
function(key, values) {
|
349
|
-
var result = { population: 0 };
|
350
|
-
values.forEach(function(value) {
|
351
|
-
result.population += value.population;
|
352
|
-
});
|
353
|
-
return result;
|
354
|
-
}}
|
355
|
-
end
|
356
|
-
|
357
|
-
let(:documents) do
|
358
|
-
[
|
359
|
-
{ name: 'Berlin', population: 3000000 },
|
360
|
-
{ name: 'London', population: 9000000 }
|
361
|
-
]
|
362
|
-
end
|
363
|
-
|
364
|
-
before do
|
365
|
-
authorized_collection.insert_many(documents)
|
366
|
-
end
|
367
|
-
|
368
|
-
let(:map_reduce) do
|
369
|
-
view.map_reduce(map, reduce)
|
370
|
-
end
|
371
|
-
|
372
|
-
context 'when incorporating read concern' do
|
373
|
-
|
374
|
-
let(:result) do
|
375
|
-
new_view.map_reduce(map, reduce, options).to_a
|
376
|
-
end
|
377
|
-
|
378
|
-
it_behaves_like 'a read concern aware operation'
|
379
|
-
end
|
380
|
-
|
381
|
-
context 'when a session supporting causal consistency is used' do
|
382
|
-
|
383
|
-
let(:view) do
|
384
|
-
Mongo::Collection::View.new(collection, selector, session: session)
|
385
|
-
end
|
386
|
-
|
387
|
-
let(:operation) do
|
388
|
-
begin; view.map_reduce(map, reduce).to_a; rescue; end
|
389
|
-
end
|
390
|
-
|
391
|
-
let(:command) do
|
392
|
-
operation
|
393
|
-
subscriber.started_events.find { |cmd| cmd.command_name == 'mapReduce' }.command
|
394
|
-
end
|
395
|
-
|
396
|
-
it_behaves_like 'an operation supporting causally consistent reads'
|
397
|
-
end
|
398
|
-
|
399
|
-
context 'when not iterating the map/reduce' do
|
400
|
-
|
401
|
-
it 'returns the map/reduce object' do
|
402
|
-
expect(map_reduce).to be_a(Mongo::Collection::View::MapReduce)
|
403
|
-
end
|
404
|
-
end
|
405
|
-
|
406
|
-
context 'when iterating the map/reduce' do
|
407
|
-
|
408
|
-
it 'yields to each document' do
|
409
|
-
map_reduce.each do |doc|
|
410
|
-
expect(doc[:_id]).to_not be_nil
|
411
|
-
end
|
412
|
-
end
|
413
|
-
end
|
414
|
-
|
415
|
-
context "when using methods to set map_reduce options" do
|
416
|
-
|
417
|
-
let(:map_reduce) do
|
418
|
-
view.send(opt, param).map_reduce(map, reduce, options)
|
419
|
-
end
|
420
|
-
|
421
|
-
context "when a :limit is given" do
|
422
|
-
let(:opt) { :limit }
|
423
|
-
let(:param) { 1 }
|
424
|
-
|
425
|
-
it "sets the option correctly" do
|
426
|
-
expect(map_reduce.options[opt]).to eq(param)
|
427
|
-
end
|
428
|
-
end
|
429
|
-
|
430
|
-
context "when a :sort is given" do
|
431
|
-
let(:opt) { :sort }
|
432
|
-
let(:param) { { 'x' => Mongo::Index::ASCENDING } }
|
433
|
-
|
434
|
-
it "sets the option correctly" do
|
435
|
-
expect(map_reduce.options[opt]).to eq(param)
|
436
|
-
end
|
437
|
-
end
|
438
|
-
|
439
|
-
context "when also including in options" do
|
440
|
-
|
441
|
-
let(:map_reduce) do
|
442
|
-
view.limit(1).map_reduce(map, reduce, { limit: 2})
|
443
|
-
end
|
444
|
-
|
445
|
-
it "sets the option correctly" do
|
446
|
-
expect(map_reduce.options[:limit]).to eq(2)
|
447
|
-
end
|
448
|
-
end
|
449
|
-
|
450
|
-
context "when a :session is given on the view" do
|
451
|
-
let(:opt) { :session }
|
452
|
-
let(:param) { authorized_client.start_session }
|
453
|
-
let(:map_reduce) do
|
454
|
-
authorized_collection.find({}, session: param).map_reduce(map, reduce, options)
|
455
|
-
end
|
456
|
-
|
457
|
-
after do
|
458
|
-
param.end_session
|
459
|
-
end
|
460
|
-
|
461
|
-
with_config_values :broken_view_options, true, false do
|
462
|
-
it "sets the option correctly" do
|
463
|
-
expect(map_reduce.options[opt]).to eq(param)
|
464
|
-
end
|
465
|
-
end
|
466
|
-
end
|
467
|
-
end
|
468
|
-
end
|
469
|
-
|
470
|
-
describe '#batch_size' do
|
471
|
-
|
472
|
-
let(:options) do
|
473
|
-
{ :batch_size => 13 }
|
474
|
-
end
|
475
|
-
|
476
|
-
context 'when a batch size is specified' do
|
477
|
-
|
478
|
-
let(:new_batch_size) do
|
479
|
-
15
|
480
|
-
end
|
481
|
-
|
482
|
-
it 'sets the batch size' do
|
483
|
-
new_view = view.batch_size(new_batch_size)
|
484
|
-
expect(new_view.batch_size).to eq(new_batch_size)
|
485
|
-
end
|
486
|
-
|
487
|
-
it 'returns a new View' do
|
488
|
-
expect(view.batch_size(new_batch_size)).not_to be(view)
|
489
|
-
end
|
490
|
-
end
|
491
|
-
|
492
|
-
context 'when a batch size is not specified' do
|
493
|
-
|
494
|
-
it 'returns the batch_size' do
|
495
|
-
expect(view.batch_size).to eq(options[:batch_size])
|
496
|
-
end
|
497
|
-
end
|
498
|
-
end
|
499
|
-
|
500
|
-
describe '#comment' do
|
501
|
-
|
502
|
-
let(:options) do
|
503
|
-
{ :comment => 'test1' }
|
504
|
-
end
|
505
|
-
|
506
|
-
context 'when a comment is specified' do
|
507
|
-
|
508
|
-
let(:new_comment) do
|
509
|
-
'test2'
|
510
|
-
end
|
511
|
-
|
512
|
-
it 'sets the comment' do
|
513
|
-
new_view = view.comment(new_comment)
|
514
|
-
expect(new_view.comment).to eq(new_comment)
|
515
|
-
end
|
516
|
-
|
517
|
-
it 'returns a new View' do
|
518
|
-
expect(view.comment(new_comment)).not_to be(view)
|
519
|
-
end
|
520
|
-
end
|
521
|
-
|
522
|
-
context 'when a comment is not specified' do
|
523
|
-
|
524
|
-
it 'returns the comment' do
|
525
|
-
expect(view.comment).to eq(options[:comment])
|
526
|
-
end
|
527
|
-
end
|
528
|
-
end
|
529
|
-
|
530
|
-
describe '#count' do
|
531
|
-
|
532
|
-
let(:documents) do
|
533
|
-
(1..10).map{ |i| { field: "test#{i}" }}
|
534
|
-
end
|
535
|
-
|
536
|
-
before do
|
537
|
-
authorized_collection.delete_many
|
538
|
-
authorized_collection.insert_many(documents)
|
539
|
-
end
|
540
|
-
|
541
|
-
let(:result) do
|
542
|
-
view.count(options)
|
543
|
-
end
|
544
|
-
|
545
|
-
context 'when incorporating read concern' do
|
546
|
-
|
547
|
-
let(:result) do
|
548
|
-
new_view.count(options)
|
549
|
-
end
|
550
|
-
|
551
|
-
it_behaves_like 'a read concern aware operation'
|
552
|
-
end
|
553
|
-
|
554
|
-
context 'when a selector is provided' do
|
555
|
-
|
556
|
-
let(:selector) do
|
557
|
-
{ field: 'test1' }
|
558
|
-
end
|
559
|
-
|
560
|
-
it 'returns the count of matching documents' do
|
561
|
-
expect(view.count).to eq(1)
|
562
|
-
end
|
563
|
-
|
564
|
-
it 'returns an integer' do
|
565
|
-
expect(view.count).to be_a(Integer)
|
566
|
-
end
|
567
|
-
end
|
568
|
-
|
569
|
-
context 'when no selector is provided' do
|
570
|
-
|
571
|
-
it 'returns the count of matching documents' do
|
572
|
-
expect(view.count).to eq(10)
|
573
|
-
end
|
574
|
-
end
|
575
|
-
|
576
|
-
context 'not sharded' do
|
577
|
-
require_topology :single, :replica_set
|
578
|
-
|
579
|
-
it 'takes a read preference option' do
|
580
|
-
# Secondary may be delayed, since this tests wants 10 documents
|
581
|
-
# it must query the primary
|
582
|
-
expect(view.count(read: { mode: :primary })).to eq(10)
|
583
|
-
end
|
584
|
-
end
|
585
|
-
|
586
|
-
context 'when a read preference is set on the view' do
|
587
|
-
require_topology :single, :replica_set
|
588
|
-
|
589
|
-
let(:client) do
|
590
|
-
# Set a timeout otherwise, the test will hang for 30 seconds.
|
591
|
-
authorized_client.with(server_selection_timeout: 1)
|
592
|
-
end
|
593
|
-
|
594
|
-
let(:collection) do
|
595
|
-
client[authorized_collection.name]
|
596
|
-
end
|
597
|
-
|
598
|
-
before do
|
599
|
-
allow(client.cluster).to receive(:single?).and_return(false)
|
600
|
-
end
|
601
|
-
|
602
|
-
let(:view) do
|
603
|
-
Mongo::Collection::View.new(collection, selector, options)
|
604
|
-
end
|
605
|
-
|
606
|
-
let(:view_with_read_pref) do
|
607
|
-
view.read(:mode => :secondary, :tag_sets => [{ 'non' => 'existent' }])
|
608
|
-
end
|
609
|
-
|
610
|
-
let(:result) do
|
611
|
-
view_with_read_pref.count
|
612
|
-
end
|
613
|
-
|
614
|
-
it 'uses the read preference setting on the view' do
|
615
|
-
expect {
|
616
|
-
result
|
617
|
-
}.to raise_exception(Mongo::Error::NoServerAvailable)
|
618
|
-
end
|
619
|
-
end
|
620
|
-
|
621
|
-
context 'when the collection has a read preference set' do
|
622
|
-
|
623
|
-
let(:client) do
|
624
|
-
# Set a timeout in case the collection read_preference does get used.
|
625
|
-
# Otherwise, the test will hang for 30 seconds.
|
626
|
-
authorized_client.with(server_selection_timeout: 1)
|
627
|
-
end
|
628
|
-
|
629
|
-
let(:read_preference) do
|
630
|
-
{ :mode => :secondary, :tag_sets => [{ 'non' => 'existent' }] }
|
631
|
-
end
|
632
|
-
|
633
|
-
let(:collection) do
|
634
|
-
client[authorized_collection.name, read: read_preference]
|
635
|
-
end
|
636
|
-
|
637
|
-
let(:view) do
|
638
|
-
Mongo::Collection::View.new(collection, selector, options)
|
639
|
-
end
|
640
|
-
|
641
|
-
context 'when a read preference argument is provided' do
|
642
|
-
|
643
|
-
let(:result) do
|
644
|
-
view.count(read: { mode: :primary })
|
645
|
-
end
|
646
|
-
|
647
|
-
it 'uses the read preference passed to the method' do
|
648
|
-
expect(result).to eq(10)
|
649
|
-
end
|
650
|
-
end
|
651
|
-
|
652
|
-
context 'when a read preference is set on the view' do
|
653
|
-
|
654
|
-
let(:view_with_read_pref) do
|
655
|
-
view.read(mode: :primary)
|
656
|
-
end
|
657
|
-
|
658
|
-
let(:result) do
|
659
|
-
view_with_read_pref.count
|
660
|
-
end
|
661
|
-
|
662
|
-
it 'uses the read preference of the view' do
|
663
|
-
expect(result).to eq(10)
|
664
|
-
end
|
665
|
-
end
|
666
|
-
|
667
|
-
context 'when no read preference argument is provided' do
|
668
|
-
require_topology :single, :replica_set
|
669
|
-
|
670
|
-
before do
|
671
|
-
allow(view.collection.client.cluster).to receive(:single?).and_return(false)
|
672
|
-
end
|
673
|
-
|
674
|
-
let(:result) do
|
675
|
-
view.count
|
676
|
-
end
|
677
|
-
|
678
|
-
it 'uses the read preference of the collection' do
|
679
|
-
expect {
|
680
|
-
result
|
681
|
-
}.to raise_exception(Mongo::Error::NoServerAvailable)
|
682
|
-
end
|
683
|
-
end
|
684
|
-
|
685
|
-
context 'when the collection does not have a read preference set' do
|
686
|
-
require_topology :single, :replica_set
|
687
|
-
|
688
|
-
let(:client) do
|
689
|
-
authorized_client.with(server_selection_timeout: 1)
|
690
|
-
end
|
691
|
-
|
692
|
-
before do
|
693
|
-
allow(view.collection.client.cluster).to receive(:single?).and_return(false)
|
694
|
-
end
|
695
|
-
|
696
|
-
let(:collection) do
|
697
|
-
client[authorized_collection.name]
|
698
|
-
end
|
699
|
-
|
700
|
-
let(:view) do
|
701
|
-
Mongo::Collection::View.new(collection, selector, options)
|
702
|
-
end
|
703
|
-
|
704
|
-
let(:result) do
|
705
|
-
read_preference = { :mode => :secondary, :tag_sets => [{ 'non' => 'existent' }] }
|
706
|
-
view.count(read: read_preference)
|
707
|
-
end
|
708
|
-
|
709
|
-
it 'uses the read preference passed to the method' do
|
710
|
-
expect {
|
711
|
-
result
|
712
|
-
}.to raise_exception(Mongo::Error::NoServerAvailable)
|
713
|
-
end
|
714
|
-
end
|
715
|
-
|
716
|
-
context 'when a read preference is set on the view' do
|
717
|
-
|
718
|
-
let(:view_with_read_pref) do
|
719
|
-
view.read(:mode => :primary)
|
720
|
-
end
|
721
|
-
|
722
|
-
let(:result) do
|
723
|
-
view_with_read_pref.count
|
724
|
-
end
|
725
|
-
|
726
|
-
it 'uses the read preference passed to the method' do
|
727
|
-
expect(result).to eq(10)
|
728
|
-
end
|
729
|
-
end
|
730
|
-
end
|
731
|
-
|
732
|
-
it 'takes a max_time_ms option' do
|
733
|
-
expect {
|
734
|
-
view.count(max_time_ms: 0.1)
|
735
|
-
}.to raise_error(Mongo::Error::OperationFailure)
|
736
|
-
end
|
737
|
-
|
738
|
-
it 'sets the max_time_ms option on the command' do
|
739
|
-
expect(view.count(max_time_ms: 100)).to eq(10)
|
740
|
-
end
|
741
|
-
|
742
|
-
context 'when a collation is specified' do
|
743
|
-
|
744
|
-
let(:selector) do
|
745
|
-
{ name: 'BANG' }
|
746
|
-
end
|
747
|
-
|
748
|
-
let(:result) do
|
749
|
-
view.count
|
750
|
-
end
|
751
|
-
|
752
|
-
before do
|
753
|
-
authorized_collection.insert_one(name: 'bang')
|
754
|
-
end
|
755
|
-
|
756
|
-
let(:options) do
|
757
|
-
{ collation: { locale: 'en_US', strength: 2 } }
|
758
|
-
end
|
759
|
-
|
760
|
-
context 'when the server selected supports collations' do
|
761
|
-
min_server_fcv '3.4'
|
762
|
-
|
763
|
-
it 'applies the collation to the count' do
|
764
|
-
expect(result).to eq(1)
|
765
|
-
end
|
766
|
-
end
|
767
|
-
|
768
|
-
context 'when the server selected does not support collations' do
|
769
|
-
max_server_version '3.2'
|
770
|
-
|
771
|
-
it 'raises an exception' do
|
772
|
-
expect {
|
773
|
-
result
|
774
|
-
}.to raise_exception(Mongo::Error::UnsupportedCollation)
|
775
|
-
end
|
776
|
-
|
777
|
-
context 'when a String key is used' do
|
778
|
-
|
779
|
-
let(:options) do
|
780
|
-
{ 'collation' => { locale: 'en_US', strength: 2 } }
|
781
|
-
end
|
782
|
-
|
783
|
-
it 'raises an exception' do
|
784
|
-
expect {
|
785
|
-
result
|
786
|
-
}.to raise_exception(Mongo::Error::UnsupportedCollation)
|
787
|
-
end
|
788
|
-
end
|
789
|
-
end
|
790
|
-
end
|
791
|
-
|
792
|
-
context 'when a collation is specified in the method options' do
|
793
|
-
|
794
|
-
let(:selector) do
|
795
|
-
{ name: 'BANG' }
|
796
|
-
end
|
797
|
-
|
798
|
-
let(:result) do
|
799
|
-
view.count(count_options)
|
800
|
-
end
|
801
|
-
|
802
|
-
before do
|
803
|
-
authorized_collection.insert_one(name: 'bang')
|
804
|
-
end
|
805
|
-
|
806
|
-
let(:count_options) do
|
807
|
-
{ collation: { locale: 'en_US', strength: 2 } }
|
808
|
-
end
|
809
|
-
|
810
|
-
context 'when the server selected supports collations' do
|
811
|
-
min_server_fcv '3.4'
|
812
|
-
|
813
|
-
it 'applies the collation to the count' do
|
814
|
-
expect(result).to eq(1)
|
815
|
-
end
|
816
|
-
end
|
817
|
-
|
818
|
-
context 'when the server selected does not support collations' do
|
819
|
-
max_server_version '3.2'
|
820
|
-
|
821
|
-
it 'raises an exception' do
|
822
|
-
expect {
|
823
|
-
result
|
824
|
-
}.to raise_exception(Mongo::Error::UnsupportedCollation)
|
825
|
-
end
|
826
|
-
|
827
|
-
context 'when a String key is used' do
|
828
|
-
|
829
|
-
let(:count_options) do
|
830
|
-
{ 'collation' => { locale: 'en_US', strength: 2 } }
|
831
|
-
end
|
832
|
-
|
833
|
-
it 'raises an exception' do
|
834
|
-
expect {
|
835
|
-
result
|
836
|
-
}.to raise_exception(Mongo::Error::UnsupportedCollation)
|
837
|
-
end
|
838
|
-
end
|
839
|
-
end
|
840
|
-
end
|
841
|
-
|
842
|
-
context "when using methods to set count options" do
|
843
|
-
let(:obj_path) { [:selector, opt] }
|
844
|
-
|
845
|
-
shared_examples "a count option" do
|
846
|
-
|
847
|
-
context "when the broken_view_options flag is off" do
|
848
|
-
config_override :broken_view_options, false
|
849
|
-
|
850
|
-
it "sets the option correctly" do
|
851
|
-
expect(Mongo::Operation::Count).to receive(:new).once.and_wrap_original do |m, *args|
|
852
|
-
opts = args.first.slice(*args.first.keys - [:session])
|
853
|
-
expect(opts.dig(*obj_path)).to eq(param)
|
854
|
-
m.call(*args)
|
855
|
-
end
|
856
|
-
view.send(opt, param).count(options)
|
857
|
-
end
|
858
|
-
end
|
859
|
-
|
860
|
-
context "when the broken_view_options flag is on" do
|
861
|
-
config_override :broken_view_options, true
|
862
|
-
|
863
|
-
it "doesn't set the option correctly" do
|
864
|
-
expect(Mongo::Operation::Count).to receive(:new).once.and_wrap_original do |m, *args|
|
865
|
-
opts = args.first.slice(*args.first.keys - [:session])
|
866
|
-
expect(opts.dig(*obj_path)).to be_nil
|
867
|
-
m.call(*args)
|
868
|
-
end
|
869
|
-
view.send(opt, param).count(options)
|
870
|
-
end
|
871
|
-
end
|
872
|
-
end
|
873
|
-
|
874
|
-
context "when a :hint is given" do
|
875
|
-
let(:opt) { :hint }
|
876
|
-
let(:param) { "_id_" }
|
877
|
-
|
878
|
-
it_behaves_like "a count option"
|
879
|
-
end
|
880
|
-
|
881
|
-
context "when a :max_time_ms is given" do
|
882
|
-
let(:opt) { :max_time_ms }
|
883
|
-
let(:param) { 5000 }
|
884
|
-
let(:obj_path) { [:selector, :maxTimeMS] }
|
885
|
-
|
886
|
-
it_behaves_like "a count option"
|
887
|
-
end
|
888
|
-
|
889
|
-
context "when a :comment is given" do
|
890
|
-
let(:opt) { :comment }
|
891
|
-
let(:param) { "comment" }
|
892
|
-
let(:obj_path) { opt }
|
893
|
-
|
894
|
-
it_behaves_like "a count option"
|
895
|
-
end
|
896
|
-
|
897
|
-
context "when a :limit is given" do
|
898
|
-
let(:opt) { :limit }
|
899
|
-
let(:param) { 1 }
|
900
|
-
|
901
|
-
it_behaves_like "a count option"
|
902
|
-
end
|
903
|
-
|
904
|
-
context "when a :skip is given" do
|
905
|
-
let(:opt) { :skip }
|
906
|
-
let(:param) { 1 }
|
907
|
-
|
908
|
-
it_behaves_like "a count option"
|
909
|
-
end
|
910
|
-
|
911
|
-
context "when a :session is given on the view" do
|
912
|
-
|
913
|
-
let(:opt) { :session }
|
914
|
-
let(:param) { authorized_client.start_session }
|
915
|
-
let(:aggregate) do
|
916
|
-
authorized_collection.find({}, session: param).aggregate(pipeline, options)
|
917
|
-
end
|
918
|
-
|
919
|
-
after do
|
920
|
-
param.end_session
|
921
|
-
end
|
922
|
-
|
923
|
-
with_config_values :broken_view_options, true, false do
|
924
|
-
it "sets the option correctly" do
|
925
|
-
expect(Mongo::Operation::Count).to receive(:new).once.and_wrap_original do |m, *args|
|
926
|
-
expect(args.first[opt]).to eq(param)
|
927
|
-
m.call(*args)
|
928
|
-
end
|
929
|
-
authorized_collection.find({}, session: param).count(options)
|
930
|
-
end
|
931
|
-
end
|
932
|
-
end
|
933
|
-
|
934
|
-
context "when also including in options" do
|
935
|
-
|
936
|
-
with_config_values :broken_view_options, true, false do
|
937
|
-
it "gives options higher precedence" do
|
938
|
-
expect(Mongo::Operation::Count).to receive(:new).once.and_wrap_original do |m, *args|
|
939
|
-
opts = args.first.slice(:selector)
|
940
|
-
expect(opts.dig(:selector, :limit)).to eq(2)
|
941
|
-
m.call(*args)
|
942
|
-
end
|
943
|
-
view.limit(1).count({ limit: 2 })
|
944
|
-
end
|
945
|
-
end
|
946
|
-
end
|
947
|
-
end
|
948
|
-
end
|
949
|
-
|
950
|
-
describe "#estimated_document_count" do
|
951
|
-
|
952
|
-
let(:result) do
|
953
|
-
view.estimated_document_count(options)
|
954
|
-
end
|
955
|
-
|
956
|
-
context 'when limit is set' do
|
957
|
-
it 'raises an error' do
|
958
|
-
expect {
|
959
|
-
view.limit(5).estimated_document_count(options)
|
960
|
-
}.to raise_error(ArgumentError, "Cannot call estimated_document_count when querying with limit")
|
961
|
-
end
|
962
|
-
end
|
963
|
-
|
964
|
-
context 'when skip is set' do
|
965
|
-
it 'raises an error' do
|
966
|
-
expect {
|
967
|
-
view.skip(5).estimated_document_count(options)
|
968
|
-
}.to raise_error(ArgumentError, "Cannot call estimated_document_count when querying with skip")
|
969
|
-
end
|
970
|
-
end
|
971
|
-
|
972
|
-
context 'when limit passed as an option' do
|
973
|
-
it 'raises an error' do
|
974
|
-
expect {
|
975
|
-
view.estimated_document_count(options.merge(limit: 5))
|
976
|
-
}.to raise_error(ArgumentError, "Cannot call estimated_document_count when querying with limit")
|
977
|
-
end
|
978
|
-
end
|
979
|
-
|
980
|
-
context 'when skip passed as an option' do
|
981
|
-
it 'raises an error' do
|
982
|
-
expect {
|
983
|
-
view.estimated_document_count(options.merge(skip: 5))
|
984
|
-
}.to raise_error(ArgumentError, "Cannot call estimated_document_count when querying with skip")
|
985
|
-
end
|
986
|
-
end
|
987
|
-
|
988
|
-
context 'when collection has documents' do
|
989
|
-
let(:documents) do
|
990
|
-
(1..10).map{ |i| { field: "test#{i}" }}
|
991
|
-
end
|
992
|
-
|
993
|
-
before do
|
994
|
-
authorized_collection.delete_many
|
995
|
-
authorized_collection.insert_many(documents)
|
996
|
-
end
|
997
|
-
|
998
|
-
context 'when a selector is provided' do
|
999
|
-
|
1000
|
-
let(:selector) do
|
1001
|
-
{ field: 'test1' }
|
1002
|
-
end
|
1003
|
-
|
1004
|
-
it 'raises an error' do
|
1005
|
-
expect {
|
1006
|
-
result
|
1007
|
-
}.to raise_error(ArgumentError, "Cannot call estimated_document_count when querying with a filter")
|
1008
|
-
end
|
1009
|
-
end
|
1010
|
-
|
1011
|
-
context 'when no selector is provided' do
|
1012
|
-
|
1013
|
-
it 'returns the estimated count of matching documents' do
|
1014
|
-
expect(view.estimated_document_count).to eq(10)
|
1015
|
-
end
|
1016
|
-
end
|
1017
|
-
end
|
1018
|
-
|
1019
|
-
context 'when collection does not exist' do
|
1020
|
-
|
1021
|
-
let(:view) do
|
1022
|
-
Mongo::Collection::View.new(
|
1023
|
-
authorized_client['nonexistent-collection-for-estimated-document-count'], selector, options)
|
1024
|
-
end
|
1025
|
-
|
1026
|
-
it 'returns 0' do
|
1027
|
-
view.estimated_document_count.should == 0
|
1028
|
-
end
|
1029
|
-
end
|
1030
|
-
|
1031
|
-
context "when using methods to set options" do
|
1032
|
-
|
1033
|
-
context "when the broken_view_options flag is on" do
|
1034
|
-
config_override :broken_view_options, true
|
1035
|
-
|
1036
|
-
context "when a :max_time_ms is given" do
|
1037
|
-
let(:opt) { :max_time_ms }
|
1038
|
-
let(:param) { 5000 }
|
1039
|
-
|
1040
|
-
it "doesn't set the option correctly" do
|
1041
|
-
expect(Mongo::Operation::Count).to receive(:new).once.and_wrap_original do |m, *args|
|
1042
|
-
opts = args.first.slice(*args.first.keys - [:session])
|
1043
|
-
expect(opts.dig(:selector, :maxTimeMS)).to be_nil
|
1044
|
-
m.call(*args)
|
1045
|
-
end
|
1046
|
-
view.send(opt, param).estimated_document_count(options)
|
1047
|
-
end
|
1048
|
-
end
|
1049
|
-
|
1050
|
-
context "when a :comment is given" do
|
1051
|
-
let(:opt) { :comment }
|
1052
|
-
let(:param) { "comment" }
|
1053
|
-
let(:obj_path) { opt }
|
1054
|
-
|
1055
|
-
it "doesn't set the option correctly" do
|
1056
|
-
expect(Mongo::Operation::Count).to receive(:new).once.and_wrap_original do |m, *args|
|
1057
|
-
opts = args.first.slice(*args.first.keys - [:session])
|
1058
|
-
expect(opts[opt]).to be_nil
|
1059
|
-
m.call(*args)
|
1060
|
-
end
|
1061
|
-
view.send(opt, param).estimated_document_count(options)
|
1062
|
-
end
|
1063
|
-
end
|
1064
|
-
end
|
1065
|
-
|
1066
|
-
context "when the broken_view_options flag is off" do
|
1067
|
-
config_override :broken_view_options, false
|
1068
|
-
|
1069
|
-
context "when a :max_time_ms is given" do
|
1070
|
-
let(:opt) { :max_time_ms }
|
1071
|
-
let(:param) { 5000 }
|
1072
|
-
|
1073
|
-
it "sets the option correctly" do
|
1074
|
-
expect(Mongo::Operation::Count).to receive(:new).once.and_wrap_original do |m, *args|
|
1075
|
-
opts = args.first.slice(*args.first.keys - [:session])
|
1076
|
-
expect(opts.dig(:selector, :maxTimeMS)).to eq(param)
|
1077
|
-
m.call(*args)
|
1078
|
-
end
|
1079
|
-
view.send(opt, param).estimated_document_count(options)
|
1080
|
-
end
|
1081
|
-
end
|
1082
|
-
|
1083
|
-
context "when a :comment is given" do
|
1084
|
-
let(:opt) { :comment }
|
1085
|
-
let(:param) { "comment" }
|
1086
|
-
let(:obj_path) { opt }
|
1087
|
-
|
1088
|
-
it "sets the option correctly" do
|
1089
|
-
expect(Mongo::Operation::Count).to receive(:new).once.and_wrap_original do |m, *args|
|
1090
|
-
opts = args.first.slice(*args.first.keys - [:session])
|
1091
|
-
expect(opts[opt]).to eq(param)
|
1092
|
-
m.call(*args)
|
1093
|
-
end
|
1094
|
-
view.send(opt, param).estimated_document_count(options)
|
1095
|
-
end
|
1096
|
-
end
|
1097
|
-
|
1098
|
-
context "when a :session is given on the view" do
|
1099
|
-
let(:opt) { :session }
|
1100
|
-
let(:param) { authorized_client.start_session }
|
1101
|
-
|
1102
|
-
after do
|
1103
|
-
param.end_session
|
1104
|
-
end
|
1105
|
-
|
1106
|
-
with_config_values :broken_view_options, true, false do
|
1107
|
-
it "sets the option correctly" do
|
1108
|
-
expect(Mongo::Operation::Count).to receive(:new).once.and_wrap_original do |m, *args|
|
1109
|
-
expect(args.first[opt]).to eq(param)
|
1110
|
-
m.call(*args)
|
1111
|
-
end
|
1112
|
-
authorized_collection.find({}, session: param).estimated_document_count(options)
|
1113
|
-
end
|
1114
|
-
end
|
1115
|
-
end
|
1116
|
-
|
1117
|
-
context "when also including in options" do
|
1118
|
-
|
1119
|
-
with_config_values :broken_view_options, true, false do
|
1120
|
-
it "gives options higher precedence" do
|
1121
|
-
expect(Mongo::Operation::Count).to receive(:new).once.and_wrap_original do |m, *args|
|
1122
|
-
opts = args.first.slice(:selector)
|
1123
|
-
expect(opts.dig(:selector, :maxTimeMS)).to eq(2000)
|
1124
|
-
m.call(*args)
|
1125
|
-
end
|
1126
|
-
view.max_time_ms(1500).estimated_document_count({ max_time_ms: 2000 })
|
1127
|
-
end
|
1128
|
-
end
|
1129
|
-
end
|
1130
|
-
end
|
1131
|
-
end
|
1132
|
-
end
|
1133
|
-
|
1134
|
-
describe '#count_documents' do
|
1135
|
-
|
1136
|
-
context 'when session is given' do
|
1137
|
-
min_server_fcv '3.6'
|
1138
|
-
|
1139
|
-
let(:subscriber) { Mrss::EventSubscriber.new }
|
1140
|
-
|
1141
|
-
before do
|
1142
|
-
authorized_collection.client.subscribe(Mongo::Monitoring::COMMAND, subscriber)
|
1143
|
-
end
|
1144
|
-
|
1145
|
-
let(:connection) do
|
1146
|
-
double('connection').tap do |connection|
|
1147
|
-
allow(connection).to receive_message_chain(:server, :cluster).and_return(authorized_client.cluster)
|
1148
|
-
end
|
1149
|
-
end
|
1150
|
-
|
1151
|
-
it 'passes the session' do
|
1152
|
-
authorized_collection.client.with_session do |session|
|
1153
|
-
session.materialize_if_needed
|
1154
|
-
session_id = session.session_id
|
1155
|
-
|
1156
|
-
authorized_collection.count_documents({}, session: session)
|
1157
|
-
|
1158
|
-
event = subscriber.single_command_started_event('aggregate')
|
1159
|
-
event.command['lsid'].should == session_id
|
1160
|
-
end
|
1161
|
-
end
|
1162
|
-
end
|
1163
|
-
|
1164
|
-
context "when using methods to set count options" do
|
1165
|
-
shared_examples "a count option" do
|
1166
|
-
context "when the broken_view_options flag is on" do
|
1167
|
-
config_override :broken_view_options, true
|
1168
|
-
|
1169
|
-
it "doesn't set the option correctly" do
|
1170
|
-
expect_any_instance_of(Mongo::Collection::View).to receive(:aggregate).once.and_wrap_original do |m, *args|
|
1171
|
-
opts = args[1]
|
1172
|
-
expect(opts[opt]).to be_nil
|
1173
|
-
m.call(*args)
|
1174
|
-
end
|
1175
|
-
view.send(opt, param).count_documents(options)
|
1176
|
-
end
|
1177
|
-
end
|
1178
|
-
|
1179
|
-
context "when the broken_view_options flag is off" do
|
1180
|
-
config_override :broken_view_options, false
|
1181
|
-
|
1182
|
-
it "sets the option correctly" do
|
1183
|
-
expect_any_instance_of(Mongo::Collection::View).to receive(:aggregate).once.and_wrap_original do |m, *args|
|
1184
|
-
opts = args[1]
|
1185
|
-
expect(opts[opt]).to eq(param)
|
1186
|
-
m.call(*args)
|
1187
|
-
end
|
1188
|
-
view.send(opt, param).count_documents(options)
|
1189
|
-
end
|
1190
|
-
end
|
1191
|
-
end
|
1192
|
-
|
1193
|
-
context "when a :hint is given" do
|
1194
|
-
let(:opt) { :hint }
|
1195
|
-
let(:param) { "_id_" }
|
1196
|
-
|
1197
|
-
it_behaves_like "a count option"
|
1198
|
-
end
|
1199
|
-
|
1200
|
-
context "when a :max_time_ms is given" do
|
1201
|
-
let(:opt) { :max_time_ms }
|
1202
|
-
let(:param) { 5000 }
|
1203
|
-
|
1204
|
-
it_behaves_like "a count option"
|
1205
|
-
end
|
1206
|
-
|
1207
|
-
context "when a :comment is given" do
|
1208
|
-
let(:opt) { :comment }
|
1209
|
-
let(:param) { "comment" }
|
1210
|
-
|
1211
|
-
it_behaves_like "a count option"
|
1212
|
-
end
|
1213
|
-
|
1214
|
-
context "when a :limit is given" do
|
1215
|
-
context "when the broken_view_options flag is false" do
|
1216
|
-
config_override :broken_view_options, false
|
1217
|
-
|
1218
|
-
it "sets the option correctly" do
|
1219
|
-
expect_any_instance_of(Mongo::Collection::View).to receive(:aggregate).once.and_wrap_original do |m, *args|
|
1220
|
-
pipeline, opts = args
|
1221
|
-
expect(pipeline[1][:'$limit']).to eq(1)
|
1222
|
-
m.call(*args)
|
1223
|
-
end
|
1224
|
-
view.limit(1).count_documents(options)
|
1225
|
-
end
|
1226
|
-
end
|
1227
|
-
|
1228
|
-
context "when the broken_view_options flag is on" do
|
1229
|
-
config_override :broken_view_options, true
|
1230
|
-
|
1231
|
-
it "doesn't set the option correctly" do
|
1232
|
-
expect_any_instance_of(Mongo::Collection::View).to receive(:aggregate).once.and_wrap_original do |m, *args|
|
1233
|
-
pipeline, opts = args
|
1234
|
-
expect(pipeline[1][:'$limit']).to be_nil
|
1235
|
-
m.call(*args)
|
1236
|
-
end
|
1237
|
-
view.limit(1).count_documents(options)
|
1238
|
-
end
|
1239
|
-
end
|
1240
|
-
end
|
1241
|
-
|
1242
|
-
context "when a :skip is given" do
|
1243
|
-
context "when the broken_view_options flag is on" do
|
1244
|
-
config_override :broken_view_options, true
|
1245
|
-
|
1246
|
-
it "doesn't set the option correctly" do
|
1247
|
-
expect_any_instance_of(Mongo::Collection::View).to receive(:aggregate).once.and_wrap_original do |m, *args|
|
1248
|
-
pipeline, opts = args
|
1249
|
-
expect(pipeline[1][:'$skip']).to be_nil
|
1250
|
-
m.call(*args)
|
1251
|
-
end
|
1252
|
-
view.skip(1).count_documents(options)
|
1253
|
-
end
|
1254
|
-
end
|
1255
|
-
|
1256
|
-
context "when the broken_view_options flag is off" do
|
1257
|
-
config_override :broken_view_options, false
|
1258
|
-
|
1259
|
-
it "sets the option correctly" do
|
1260
|
-
expect_any_instance_of(Mongo::Collection::View).to receive(:aggregate).once.and_wrap_original do |m, *args|
|
1261
|
-
pipeline, opts = args
|
1262
|
-
expect(pipeline[1][:'$skip']).to eq(1)
|
1263
|
-
m.call(*args)
|
1264
|
-
end
|
1265
|
-
view.skip(1).count_documents(options)
|
1266
|
-
end
|
1267
|
-
end
|
1268
|
-
end
|
1269
|
-
|
1270
|
-
context "when a :session is given on the view" do
|
1271
|
-
let(:opt) { :session }
|
1272
|
-
let(:param) { authorized_client.start_session }
|
1273
|
-
|
1274
|
-
after do
|
1275
|
-
param.end_session
|
1276
|
-
end
|
1277
|
-
|
1278
|
-
context "when broken_view_options is false" do
|
1279
|
-
config_override :broken_view_options, false
|
1280
|
-
it "sets the option correctly" do
|
1281
|
-
expect_any_instance_of(Mongo::Collection::View).to receive(:aggregate).once.and_wrap_original do |m, *args|
|
1282
|
-
expect(args[1][opt]).to eq(param)
|
1283
|
-
m.call(*args)
|
1284
|
-
end
|
1285
|
-
authorized_collection.find({}, session: param).count_documents(options)
|
1286
|
-
end
|
1287
|
-
end
|
1288
|
-
|
1289
|
-
context "when broken_view_options is true" do
|
1290
|
-
config_override :broken_view_options, true
|
1291
|
-
it "does not set the option" do
|
1292
|
-
expect_any_instance_of(Mongo::Collection::View).to receive(:aggregate).once.and_wrap_original do |m, *args|
|
1293
|
-
expect(args[1][opt]).to be nil
|
1294
|
-
m.call(*args)
|
1295
|
-
end
|
1296
|
-
authorized_collection.find({}, session: param).count_documents(options)
|
1297
|
-
end
|
1298
|
-
end
|
1299
|
-
end
|
1300
|
-
|
1301
|
-
context "when also including in options" do
|
1302
|
-
|
1303
|
-
with_config_values :broken_view_options, true, false do
|
1304
|
-
it "gives options higher precedence" do
|
1305
|
-
expect_any_instance_of(Mongo::Collection::View).to receive(:aggregate).once.and_wrap_original do |m, *args|
|
1306
|
-
pipeline, opts = args
|
1307
|
-
expect(pipeline[1][:'$limit']).to eq(2)
|
1308
|
-
m.call(*args)
|
1309
|
-
end
|
1310
|
-
view.limit(1).count_documents({ limit: 2 })
|
1311
|
-
end
|
1312
|
-
end
|
1313
|
-
end
|
1314
|
-
end
|
1315
|
-
end
|
1316
|
-
|
1317
|
-
describe '#distinct' do
|
1318
|
-
|
1319
|
-
context 'when incorporating read concern' do
|
1320
|
-
|
1321
|
-
let(:result) do
|
1322
|
-
new_view.distinct(:field, options)
|
1323
|
-
end
|
1324
|
-
|
1325
|
-
it_behaves_like 'a read concern aware operation'
|
1326
|
-
end
|
1327
|
-
|
1328
|
-
context 'when a selector is provided' do
|
1329
|
-
|
1330
|
-
let(:selector) do
|
1331
|
-
{ field: 'test' }
|
1332
|
-
end
|
1333
|
-
|
1334
|
-
let(:documents) do
|
1335
|
-
(1..3).map{ |i| { field: "test" }}
|
1336
|
-
end
|
1337
|
-
|
1338
|
-
before do
|
1339
|
-
authorized_collection.insert_many(documents)
|
1340
|
-
end
|
1341
|
-
|
1342
|
-
context 'when the field is a symbol' do
|
1343
|
-
|
1344
|
-
let(:distinct) do
|
1345
|
-
view.distinct(:field)
|
1346
|
-
end
|
1347
|
-
|
1348
|
-
it 'returns the distinct values' do
|
1349
|
-
expect(distinct).to eq([ 'test' ])
|
1350
|
-
end
|
1351
|
-
end
|
1352
|
-
|
1353
|
-
context 'when the field is a string' do
|
1354
|
-
|
1355
|
-
let(:distinct) do
|
1356
|
-
view.distinct('field')
|
1357
|
-
end
|
1358
|
-
|
1359
|
-
it 'returns the distinct values' do
|
1360
|
-
expect(distinct).to eq([ 'test' ])
|
1361
|
-
end
|
1362
|
-
end
|
1363
|
-
|
1364
|
-
context 'when the field is nil' do
|
1365
|
-
|
1366
|
-
let(:distinct) do
|
1367
|
-
view.distinct(nil)
|
1368
|
-
end
|
1369
|
-
|
1370
|
-
it 'raises ArgumentError' do
|
1371
|
-
expect do
|
1372
|
-
distinct
|
1373
|
-
end.to raise_error(ArgumentError, 'Field name for distinct operation must be not nil')
|
1374
|
-
end
|
1375
|
-
end
|
1376
|
-
|
1377
|
-
context 'when the field does not exist' do
|
1378
|
-
|
1379
|
-
let(:distinct) do
|
1380
|
-
view.distinct(:doesnotexist)
|
1381
|
-
end
|
1382
|
-
|
1383
|
-
it 'returns an empty array' do
|
1384
|
-
expect(distinct).to be_empty
|
1385
|
-
end
|
1386
|
-
end
|
1387
|
-
end
|
1388
|
-
|
1389
|
-
context 'when no selector is provided' do
|
1390
|
-
|
1391
|
-
let(:documents) do
|
1392
|
-
(1..3).map{ |i| { field: "test#{i}" }}
|
1393
|
-
end
|
1394
|
-
|
1395
|
-
before do
|
1396
|
-
authorized_collection.insert_many(documents)
|
1397
|
-
end
|
1398
|
-
|
1399
|
-
context 'when the field is a symbol' do
|
1400
|
-
|
1401
|
-
let(:distinct) do
|
1402
|
-
view.distinct(:field)
|
1403
|
-
end
|
1404
|
-
|
1405
|
-
it 'returns the distinct values' do
|
1406
|
-
expect(distinct.sort).to eq([ 'test1', 'test2', 'test3' ])
|
1407
|
-
end
|
1408
|
-
end
|
1409
|
-
|
1410
|
-
context 'when the field is a string' do
|
1411
|
-
|
1412
|
-
let(:distinct) do
|
1413
|
-
view.distinct('field')
|
1414
|
-
end
|
1415
|
-
|
1416
|
-
it 'returns the distinct values' do
|
1417
|
-
expect(distinct.sort).to eq([ 'test1', 'test2', 'test3' ])
|
1418
|
-
end
|
1419
|
-
end
|
1420
|
-
|
1421
|
-
context 'when the field is nil' do
|
1422
|
-
|
1423
|
-
let(:distinct) do
|
1424
|
-
view.distinct(nil)
|
1425
|
-
end
|
1426
|
-
|
1427
|
-
it 'raises ArgumentError' do
|
1428
|
-
expect do
|
1429
|
-
distinct
|
1430
|
-
end.to raise_error(ArgumentError, 'Field name for distinct operation must be not nil')
|
1431
|
-
end
|
1432
|
-
end
|
1433
|
-
end
|
1434
|
-
|
1435
|
-
context 'when a read preference is set on the view' do
|
1436
|
-
require_topology :single, :replica_set
|
1437
|
-
|
1438
|
-
let(:client) do
|
1439
|
-
# Set a timeout otherwise, the test will hang for 30 seconds.
|
1440
|
-
authorized_client.with(server_selection_timeout: 1)
|
1441
|
-
end
|
1442
|
-
|
1443
|
-
let(:collection) do
|
1444
|
-
client[authorized_collection.name]
|
1445
|
-
end
|
1446
|
-
|
1447
|
-
before do
|
1448
|
-
allow(client.cluster).to receive(:single?).and_return(false)
|
1449
|
-
end
|
1450
|
-
|
1451
|
-
let(:view) do
|
1452
|
-
Mongo::Collection::View.new(collection, selector, options)
|
1453
|
-
end
|
1454
|
-
|
1455
|
-
let(:view_with_read_pref) do
|
1456
|
-
view.read(:mode => :secondary, :tag_sets => [{ 'non' => 'existent' }])
|
1457
|
-
end
|
1458
|
-
|
1459
|
-
let(:result) do
|
1460
|
-
view_with_read_pref.distinct(:field)
|
1461
|
-
end
|
1462
|
-
|
1463
|
-
it 'uses the read preference setting on the view' do
|
1464
|
-
expect {
|
1465
|
-
result
|
1466
|
-
}.to raise_exception(Mongo::Error::NoServerAvailable)
|
1467
|
-
end
|
1468
|
-
end
|
1469
|
-
|
1470
|
-
context 'when the collection has a read preference set' do
|
1471
|
-
|
1472
|
-
let(:documents) do
|
1473
|
-
(1..3).map{ |i| { field: "test#{i}" }}
|
1474
|
-
end
|
1475
|
-
|
1476
|
-
before do
|
1477
|
-
authorized_collection.insert_many(documents)
|
1478
|
-
end
|
1479
|
-
|
1480
|
-
let(:client) do
|
1481
|
-
# Set a timeout in case the collection read_preference does get used.
|
1482
|
-
# Otherwise, the test will hang for 30 seconds.
|
1483
|
-
authorized_client.with(server_selection_timeout: 1)
|
1484
|
-
end
|
1485
|
-
|
1486
|
-
let(:read_preference) do
|
1487
|
-
{ :mode => :secondary, :tag_sets => [{ 'non' => 'existent' }] }
|
1488
|
-
end
|
1489
|
-
|
1490
|
-
let(:collection) do
|
1491
|
-
client[authorized_collection.name, read: read_preference]
|
1492
|
-
end
|
1493
|
-
|
1494
|
-
let(:view) do
|
1495
|
-
Mongo::Collection::View.new(collection, selector, options)
|
1496
|
-
end
|
1497
|
-
|
1498
|
-
context 'when a read preference argument is provided' do
|
1499
|
-
|
1500
|
-
let(:distinct) do
|
1501
|
-
view.distinct(:field, read: { mode: :primary })
|
1502
|
-
end
|
1503
|
-
|
1504
|
-
it 'uses the read preference passed to the method' do
|
1505
|
-
expect(distinct.sort).to eq([ 'test1', 'test2', 'test3' ])
|
1506
|
-
end
|
1507
|
-
end
|
1508
|
-
|
1509
|
-
context 'when no read preference argument is provided' do
|
1510
|
-
require_topology :single, :replica_set
|
1511
|
-
|
1512
|
-
before do
|
1513
|
-
allow(view.collection.client.cluster).to receive(:single?).and_return(false)
|
1514
|
-
end
|
1515
|
-
|
1516
|
-
let(:distinct) do
|
1517
|
-
view.distinct(:field)
|
1518
|
-
end
|
1519
|
-
|
1520
|
-
it 'uses the read preference of the collection' do
|
1521
|
-
expect {
|
1522
|
-
distinct
|
1523
|
-
}.to raise_exception(Mongo::Error::NoServerAvailable)
|
1524
|
-
end
|
1525
|
-
end
|
1526
|
-
|
1527
|
-
context 'when the collection does not have a read preference set' do
|
1528
|
-
require_topology :single, :replica_set
|
1529
|
-
|
1530
|
-
let(:documents) do
|
1531
|
-
(1..3).map{ |i| { field: "test#{i}" }}
|
1532
|
-
end
|
1533
|
-
|
1534
|
-
before do
|
1535
|
-
authorized_collection.insert_many(documents)
|
1536
|
-
allow(view.collection.client.cluster).to receive(:single?).and_return(false)
|
1537
|
-
end
|
1538
|
-
|
1539
|
-
let(:client) do
|
1540
|
-
authorized_client.with(server_selection_timeout: 1)
|
1541
|
-
end
|
1542
|
-
|
1543
|
-
let(:collection) do
|
1544
|
-
client[authorized_collection.name]
|
1545
|
-
end
|
1546
|
-
|
1547
|
-
let(:view) do
|
1548
|
-
Mongo::Collection::View.new(collection, selector, options)
|
1549
|
-
end
|
1550
|
-
|
1551
|
-
let(:distinct) do
|
1552
|
-
read_preference = { :mode => :secondary, :tag_sets => [{ 'non' => 'existent' }] }
|
1553
|
-
view.distinct(:field, read: read_preference)
|
1554
|
-
end
|
1555
|
-
|
1556
|
-
it 'uses the read preference passed to the method' do
|
1557
|
-
expect {
|
1558
|
-
distinct
|
1559
|
-
}.to raise_exception(Mongo::Error::NoServerAvailable)
|
1560
|
-
end
|
1561
|
-
end
|
1562
|
-
|
1563
|
-
context 'when a read preference is set on the view' do
|
1564
|
-
|
1565
|
-
let(:view_with_read_pref) do
|
1566
|
-
view.read(:mode => :secondary, :tag_sets => [{ 'non' => 'existent' }])
|
1567
|
-
end
|
1568
|
-
|
1569
|
-
let(:distinct) do
|
1570
|
-
view_with_read_pref.distinct(:field, read: { mode: :primary })
|
1571
|
-
end
|
1572
|
-
|
1573
|
-
it 'uses the read preference passed to the method' do
|
1574
|
-
expect(distinct.sort).to eq([ 'test1', 'test2', 'test3' ])
|
1575
|
-
end
|
1576
|
-
end
|
1577
|
-
end
|
1578
|
-
|
1579
|
-
context 'when a max_time_ms is specified' do
|
1580
|
-
|
1581
|
-
let(:documents) do
|
1582
|
-
(1..3).map{ |i| { field: "test" }}
|
1583
|
-
end
|
1584
|
-
|
1585
|
-
before do
|
1586
|
-
authorized_collection.insert_many(documents)
|
1587
|
-
end
|
1588
|
-
|
1589
|
-
it 'sets the max_time_ms option on the command' do
|
1590
|
-
expect {
|
1591
|
-
view.distinct(:field, max_time_ms: 0.1)
|
1592
|
-
}.to raise_error(Mongo::Error::OperationFailure)
|
1593
|
-
end
|
1594
|
-
|
1595
|
-
it 'sets the max_time_ms option on the command' do
|
1596
|
-
expect(view.distinct(:field, max_time_ms: 100)).to eq([ 'test' ])
|
1597
|
-
end
|
1598
|
-
end
|
1599
|
-
|
1600
|
-
context 'when the field does not exist' do
|
1601
|
-
|
1602
|
-
it 'returns an empty array' do
|
1603
|
-
expect(view.distinct(:nofieldexists)).to be_empty
|
1604
|
-
end
|
1605
|
-
end
|
1606
|
-
|
1607
|
-
context 'when a collation is specified on the view' do
|
1608
|
-
|
1609
|
-
let(:result) do
|
1610
|
-
view.distinct(:name)
|
1611
|
-
end
|
1612
|
-
|
1613
|
-
before do
|
1614
|
-
authorized_collection.insert_one(name: 'bang')
|
1615
|
-
authorized_collection.insert_one(name: 'BANG')
|
1616
|
-
end
|
1617
|
-
|
1618
|
-
let(:options) do
|
1619
|
-
{ collation: { locale: 'en_US', strength: 2 } }
|
1620
|
-
end
|
1621
|
-
|
1622
|
-
context 'when the server selected supports collations' do
|
1623
|
-
min_server_fcv '3.4'
|
1624
|
-
|
1625
|
-
it 'applies the collation to the distinct' do
|
1626
|
-
expect(result).to eq(['bang'])
|
1627
|
-
end
|
1628
|
-
end
|
1629
|
-
|
1630
|
-
context 'when the server selected does not support collations' do
|
1631
|
-
max_server_version '3.2'
|
1632
|
-
|
1633
|
-
it 'raises an exception' do
|
1634
|
-
expect {
|
1635
|
-
result
|
1636
|
-
}.to raise_exception(Mongo::Error::UnsupportedCollation)
|
1637
|
-
end
|
1638
|
-
|
1639
|
-
context 'when a String key is used' do
|
1640
|
-
|
1641
|
-
let(:options) do
|
1642
|
-
{ 'collation' => { locale: 'en_US', strength: 2 } }
|
1643
|
-
end
|
1644
|
-
|
1645
|
-
it 'raises an exception' do
|
1646
|
-
expect {
|
1647
|
-
result
|
1648
|
-
}.to raise_exception(Mongo::Error::UnsupportedCollation)
|
1649
|
-
end
|
1650
|
-
end
|
1651
|
-
end
|
1652
|
-
end
|
1653
|
-
|
1654
|
-
context 'when a collation is specified in the method options' do
|
1655
|
-
|
1656
|
-
let(:result) do
|
1657
|
-
view.distinct(:name, distinct_options)
|
1658
|
-
end
|
1659
|
-
|
1660
|
-
before do
|
1661
|
-
authorized_collection.insert_one(name: 'bang')
|
1662
|
-
authorized_collection.insert_one(name: 'BANG')
|
1663
|
-
end
|
1664
|
-
|
1665
|
-
let(:distinct_options) do
|
1666
|
-
{ collation: { locale: 'en_US', strength: 2 } }
|
1667
|
-
end
|
1668
|
-
|
1669
|
-
context 'when the server selected supports collations' do
|
1670
|
-
min_server_fcv '3.4'
|
1671
|
-
|
1672
|
-
it 'applies the collation to the distinct' do
|
1673
|
-
expect(result).to eq(['bang'])
|
1674
|
-
end
|
1675
|
-
end
|
1676
|
-
|
1677
|
-
context 'when the server selected does not support collations' do
|
1678
|
-
max_server_version '3.2'
|
1679
|
-
|
1680
|
-
it 'raises an exception' do
|
1681
|
-
expect {
|
1682
|
-
result
|
1683
|
-
}.to raise_exception(Mongo::Error::UnsupportedCollation)
|
1684
|
-
end
|
1685
|
-
|
1686
|
-
context 'when a String key is used' do
|
1687
|
-
|
1688
|
-
let(:distinct_options) do
|
1689
|
-
{ 'collation' => { locale: 'en_US', strength: 2 } }
|
1690
|
-
end
|
1691
|
-
|
1692
|
-
it 'raises an exception' do
|
1693
|
-
expect {
|
1694
|
-
result
|
1695
|
-
}.to raise_exception(Mongo::Error::UnsupportedCollation)
|
1696
|
-
end
|
1697
|
-
end
|
1698
|
-
end
|
1699
|
-
end
|
1700
|
-
|
1701
|
-
context 'when a collation is not specified' do
|
1702
|
-
|
1703
|
-
let(:result) do
|
1704
|
-
view.distinct(:name)
|
1705
|
-
end
|
1706
|
-
|
1707
|
-
before do
|
1708
|
-
authorized_collection.insert_one(name: 'bang')
|
1709
|
-
authorized_collection.insert_one(name: 'BANG')
|
1710
|
-
end
|
1711
|
-
|
1712
|
-
it 'does not apply the collation to the distinct' do
|
1713
|
-
expect(result).to match_array(['bang', 'BANG'])
|
1714
|
-
end
|
1715
|
-
end
|
1716
|
-
|
1717
|
-
context "when using methods to set options" do
|
1718
|
-
|
1719
|
-
context "when a :max_time_ms is given" do
|
1720
|
-
let(:opt) { :max_time_ms }
|
1721
|
-
let(:param) { 5000 }
|
1722
|
-
|
1723
|
-
context "when the broken_view_options flag is on" do
|
1724
|
-
config_override :broken_view_options, true
|
1725
|
-
|
1726
|
-
it "doesn't set the option correctly" do
|
1727
|
-
expect(Mongo::Operation::Distinct).to receive(:new).once.and_wrap_original do |m, *args|
|
1728
|
-
opts = args.first.slice(*args.first.keys - [:session])
|
1729
|
-
expect(opts.dig(:selector, :maxTimeMS)).to be_nil
|
1730
|
-
m.call(*args)
|
1731
|
-
end
|
1732
|
-
view.send(opt, param).distinct(:name, options)
|
1733
|
-
end
|
1734
|
-
end
|
1735
|
-
|
1736
|
-
context "when the broken_view_options flag is off" do
|
1737
|
-
config_override :broken_view_options, false
|
1738
|
-
|
1739
|
-
it "sets the option correctly" do
|
1740
|
-
expect(Mongo::Operation::Distinct).to receive(:new).once.and_wrap_original do |m, *args|
|
1741
|
-
opts = args.first.slice(*args.first.keys - [:session])
|
1742
|
-
expect(opts.dig(:selector, :maxTimeMS)).to eq(param)
|
1743
|
-
m.call(*args)
|
1744
|
-
end
|
1745
|
-
view.send(opt, param).distinct(:name, options)
|
1746
|
-
end
|
1747
|
-
end
|
1748
|
-
end
|
1749
|
-
|
1750
|
-
context "when a :comment is given" do
|
1751
|
-
let(:opt) { :comment }
|
1752
|
-
let(:param) { "comment" }
|
1753
|
-
let(:obj_path) { opt }
|
1754
|
-
|
1755
|
-
context "when the broken_view_options flag is on" do
|
1756
|
-
config_override :broken_view_options, true
|
1757
|
-
|
1758
|
-
it "doesn't set the option correctly" do
|
1759
|
-
expect(Mongo::Operation::Distinct).to receive(:new).once.and_wrap_original do |m, *args|
|
1760
|
-
opts = args.first.slice(*args.first.keys - [:session])
|
1761
|
-
expect(opts[opt]).to be_nil
|
1762
|
-
m.call(*args)
|
1763
|
-
end
|
1764
|
-
view.send(opt, param).distinct(:name, options)
|
1765
|
-
end
|
1766
|
-
end
|
1767
|
-
|
1768
|
-
context "when the broken_view_options flag is off" do
|
1769
|
-
config_override :broken_view_options, false
|
1770
|
-
|
1771
|
-
it "sets the option correctly" do
|
1772
|
-
expect(Mongo::Operation::Distinct).to receive(:new).once.and_wrap_original do |m, *args|
|
1773
|
-
opts = args.first.slice(*args.first.keys - [:session])
|
1774
|
-
expect(opts[opt]).to eq(param)
|
1775
|
-
m.call(*args)
|
1776
|
-
end
|
1777
|
-
view.send(opt, param).distinct(:name, options)
|
1778
|
-
end
|
1779
|
-
end
|
1780
|
-
end
|
1781
|
-
|
1782
|
-
context "when a :session is given on the view" do
|
1783
|
-
let(:opt) { :session }
|
1784
|
-
let(:param) { authorized_client.start_session }
|
1785
|
-
|
1786
|
-
after do
|
1787
|
-
param.end_session
|
1788
|
-
end
|
1789
|
-
|
1790
|
-
with_config_values :broken_view_options, true, false do
|
1791
|
-
it "sets the option correctly" do
|
1792
|
-
expect(Mongo::Operation::Distinct).to receive(:new).once.and_wrap_original do |m, *args|
|
1793
|
-
expect(args.first[opt]).to eq(param)
|
1794
|
-
m.call(*args)
|
1795
|
-
end
|
1796
|
-
authorized_collection.find({}, session: param).distinct(options)
|
1797
|
-
end
|
1798
|
-
end
|
1799
|
-
end
|
1800
|
-
|
1801
|
-
context "when also including in options" do
|
1802
|
-
|
1803
|
-
with_config_values :broken_view_options, true, false do
|
1804
|
-
it "gives options higher precedence" do
|
1805
|
-
expect(Mongo::Operation::Distinct).to receive(:new).once.and_wrap_original do |m, *args|
|
1806
|
-
opts = args.first.slice(:selector)
|
1807
|
-
expect(opts.dig(:selector, :maxTimeMS)).to eq(2000)
|
1808
|
-
m.call(*args)
|
1809
|
-
end
|
1810
|
-
view.max_time_ms(1500).distinct(:name, { max_time_ms: 2000 })
|
1811
|
-
end
|
1812
|
-
end
|
1813
|
-
end
|
1814
|
-
end
|
1815
|
-
end
|
1816
|
-
|
1817
|
-
describe '#hint' do
|
1818
|
-
|
1819
|
-
context 'when a hint is specified' do
|
1820
|
-
|
1821
|
-
let(:options) do
|
1822
|
-
{ :hint => { 'x' => Mongo::Index::ASCENDING } }
|
1823
|
-
end
|
1824
|
-
|
1825
|
-
let(:new_hint) do
|
1826
|
-
{ 'x' => Mongo::Index::DESCENDING }
|
1827
|
-
end
|
1828
|
-
|
1829
|
-
it 'sets the hint' do
|
1830
|
-
new_view = view.hint(new_hint)
|
1831
|
-
expect(new_view.hint).to eq(new_hint)
|
1832
|
-
end
|
1833
|
-
|
1834
|
-
it 'returns a new View' do
|
1835
|
-
expect(view.hint(new_hint)).not_to be(view)
|
1836
|
-
end
|
1837
|
-
end
|
1838
|
-
|
1839
|
-
context 'when a hint is not specified' do
|
1840
|
-
|
1841
|
-
let(:options) do
|
1842
|
-
{ :hint => 'x' }
|
1843
|
-
end
|
1844
|
-
|
1845
|
-
it 'returns the hint' do
|
1846
|
-
expect(view.hint).to eq(options[:hint])
|
1847
|
-
end
|
1848
|
-
end
|
1849
|
-
end
|
1850
|
-
|
1851
|
-
describe '#limit' do
|
1852
|
-
|
1853
|
-
context 'when a limit is specified' do
|
1854
|
-
|
1855
|
-
let(:options) do
|
1856
|
-
{ :limit => 5 }
|
1857
|
-
end
|
1858
|
-
|
1859
|
-
let(:new_limit) do
|
1860
|
-
10
|
1861
|
-
end
|
1862
|
-
|
1863
|
-
it 'sets the limit' do
|
1864
|
-
new_view = view.limit(new_limit)
|
1865
|
-
expect(new_view.limit).to eq(new_limit)
|
1866
|
-
end
|
1867
|
-
|
1868
|
-
it 'returns a new View' do
|
1869
|
-
expect(view.limit(new_limit)).not_to be(view)
|
1870
|
-
end
|
1871
|
-
end
|
1872
|
-
|
1873
|
-
context 'when a limit is not specified' do
|
1874
|
-
|
1875
|
-
let(:options) do
|
1876
|
-
{ :limit => 5 }
|
1877
|
-
end
|
1878
|
-
|
1879
|
-
it 'returns the limit' do
|
1880
|
-
expect(view.limit).to eq(options[:limit])
|
1881
|
-
end
|
1882
|
-
end
|
1883
|
-
end
|
1884
|
-
|
1885
|
-
describe '#max_scan' do
|
1886
|
-
|
1887
|
-
let(:new_view) do
|
1888
|
-
view.max_scan(10)
|
1889
|
-
end
|
1890
|
-
|
1891
|
-
it 'sets the value in the options' do
|
1892
|
-
expect(new_view.max_scan).to eq(10)
|
1893
|
-
end
|
1894
|
-
end
|
1895
|
-
|
1896
|
-
describe '#max_value' do
|
1897
|
-
|
1898
|
-
let(:new_view) do
|
1899
|
-
view.max_value(_id: 1)
|
1900
|
-
end
|
1901
|
-
|
1902
|
-
it 'sets the value in the options' do
|
1903
|
-
expect(new_view.max_value).to eq('_id' => 1)
|
1904
|
-
end
|
1905
|
-
end
|
1906
|
-
|
1907
|
-
describe '#min_value' do
|
1908
|
-
|
1909
|
-
let(:new_view) do
|
1910
|
-
view.min_value(_id: 1)
|
1911
|
-
end
|
1912
|
-
|
1913
|
-
it 'sets the value in the options' do
|
1914
|
-
expect(new_view.min_value).to eq('_id' => 1)
|
1915
|
-
end
|
1916
|
-
end
|
1917
|
-
|
1918
|
-
describe '#no_cursor_timeout' do
|
1919
|
-
|
1920
|
-
let(:new_view) do
|
1921
|
-
view.no_cursor_timeout
|
1922
|
-
end
|
1923
|
-
|
1924
|
-
it 'sets the flag' do
|
1925
|
-
expect(new_view.options[:no_cursor_timeout]).to be true
|
1926
|
-
end
|
1927
|
-
|
1928
|
-
it 'returns a new View' do
|
1929
|
-
expect(new_view).not_to be(view)
|
1930
|
-
end
|
1931
|
-
|
1932
|
-
context 'when sending to server' do
|
1933
|
-
let(:subscriber) { Mrss::EventSubscriber.new }
|
1934
|
-
|
1935
|
-
before do
|
1936
|
-
authorized_collection.client.subscribe(Mongo::Monitoring::COMMAND, subscriber)
|
1937
|
-
end
|
1938
|
-
|
1939
|
-
let(:event) do
|
1940
|
-
subscriber.single_command_started_event('find')
|
1941
|
-
end
|
1942
|
-
|
1943
|
-
it 'is sent to server' do
|
1944
|
-
new_view.to_a
|
1945
|
-
event.command.slice('noCursorTimeout').should == {'noCursorTimeout' => true}
|
1946
|
-
end
|
1947
|
-
end
|
1948
|
-
|
1949
|
-
context 'integration test' do
|
1950
|
-
require_topology :single
|
1951
|
-
|
1952
|
-
# The number of open cursors with the option set to prevent timeout.
|
1953
|
-
def current_no_timeout_count
|
1954
|
-
root_authorized_client
|
1955
|
-
.command(serverStatus: 1)
|
1956
|
-
.documents
|
1957
|
-
.first
|
1958
|
-
.fetch('metrics')
|
1959
|
-
.fetch('cursor')
|
1960
|
-
.fetch('open')
|
1961
|
-
.fetch('noTimeout')
|
1962
|
-
end
|
1963
|
-
|
1964
|
-
it 'is applied on the server' do
|
1965
|
-
# Initialize collection with two documents.
|
1966
|
-
new_view.collection.insert_many([{}, {}])
|
1967
|
-
|
1968
|
-
expect(new_view.count).to be == 2
|
1969
|
-
|
1970
|
-
# Initial "noTimeout" count should be zero.
|
1971
|
-
states = [current_no_timeout_count]
|
1972
|
-
|
1973
|
-
# The "noTimeout" count should be one while iterating.
|
1974
|
-
new_view.batch_size(1).each { states << current_no_timeout_count }
|
1975
|
-
|
1976
|
-
# Final "noTimeout" count should be back to zero.
|
1977
|
-
states << current_no_timeout_count
|
1978
|
-
|
1979
|
-
# This succeeds on:
|
1980
|
-
# commit aab776ebdfb15ddb9765039f7300e15796de0c5c
|
1981
|
-
#
|
1982
|
-
# This starts failing with [0, 0, 0, 0] from:
|
1983
|
-
# commit 2d9f0217ec904a1952a1ada2136502eefbca562e
|
1984
|
-
expect(states).to be == [0, 1, 1, 0]
|
1985
|
-
end
|
1986
|
-
end
|
1987
|
-
end
|
1988
|
-
|
1989
|
-
describe '#projection' do
|
1990
|
-
|
1991
|
-
let(:options) do
|
1992
|
-
{ :projection => { 'x' => 1 } }
|
1993
|
-
end
|
1994
|
-
|
1995
|
-
context 'when projection are specified' do
|
1996
|
-
|
1997
|
-
let(:new_projection) do
|
1998
|
-
{ 'y' => 1 }
|
1999
|
-
end
|
2000
|
-
|
2001
|
-
before do
|
2002
|
-
authorized_collection.insert_one(y: 'value', a: 'other_value')
|
2003
|
-
end
|
2004
|
-
|
2005
|
-
it 'sets the projection' do
|
2006
|
-
new_view = view.projection(new_projection)
|
2007
|
-
expect(new_view.projection).to eq(new_projection)
|
2008
|
-
end
|
2009
|
-
|
2010
|
-
it 'returns a new View' do
|
2011
|
-
expect(view.projection(new_projection)).not_to be(view)
|
2012
|
-
end
|
2013
|
-
|
2014
|
-
it 'returns only that field on the collection' do
|
2015
|
-
expect(view.projection(new_projection).first.keys).to match_array(['_id', 'y'])
|
2016
|
-
end
|
2017
|
-
end
|
2018
|
-
|
2019
|
-
context 'when projection is not specified' do
|
2020
|
-
|
2021
|
-
it 'returns the projection' do
|
2022
|
-
expect(view.projection).to eq(options[:projection])
|
2023
|
-
end
|
2024
|
-
end
|
2025
|
-
|
2026
|
-
context 'when projection is not a document' do
|
2027
|
-
|
2028
|
-
let(:new_projection) do
|
2029
|
-
'y'
|
2030
|
-
end
|
2031
|
-
|
2032
|
-
it 'raises an error' do
|
2033
|
-
expect do
|
2034
|
-
view.projection(new_projection)
|
2035
|
-
end.to raise_error(Mongo::Error::InvalidDocument)
|
2036
|
-
end
|
2037
|
-
end
|
2038
|
-
end
|
2039
|
-
|
2040
|
-
describe '#read' do
|
2041
|
-
|
2042
|
-
context 'when a read pref is specified' do
|
2043
|
-
|
2044
|
-
let(:options) do
|
2045
|
-
{ :read => { :mode => :secondary } }
|
2046
|
-
end
|
2047
|
-
|
2048
|
-
let(:new_read) do
|
2049
|
-
{ :mode => :secondary_preferred }
|
2050
|
-
end
|
2051
|
-
|
2052
|
-
it 'sets the read preference' do
|
2053
|
-
new_view = view.read(new_read)
|
2054
|
-
expect(new_view.read).to eq(BSON::Document.new(new_read))
|
2055
|
-
end
|
2056
|
-
|
2057
|
-
it 'returns a new View' do
|
2058
|
-
expect(view.read(new_read)).not_to be(view)
|
2059
|
-
end
|
2060
|
-
end
|
2061
|
-
|
2062
|
-
context 'when a read pref is not specified' do
|
2063
|
-
|
2064
|
-
let(:options) do
|
2065
|
-
{ :read => {:mode => :secondary} }
|
2066
|
-
end
|
2067
|
-
|
2068
|
-
it 'returns the read preference' do
|
2069
|
-
expect(view.read).to eq(BSON::Document.new(options[:read]))
|
2070
|
-
end
|
2071
|
-
|
2072
|
-
context 'when no read pref is set on initialization' do
|
2073
|
-
|
2074
|
-
let(:options) do
|
2075
|
-
{}
|
2076
|
-
end
|
2077
|
-
|
2078
|
-
it 'returns the collection read preference' do
|
2079
|
-
expect(view.read).to eq(authorized_collection.read_preference)
|
2080
|
-
end
|
2081
|
-
end
|
2082
|
-
end
|
2083
|
-
end
|
2084
|
-
|
2085
|
-
describe '#show_disk_loc' do
|
2086
|
-
|
2087
|
-
let(:options) do
|
2088
|
-
{ :show_disk_loc => true }
|
2089
|
-
end
|
2090
|
-
|
2091
|
-
context 'when show_disk_loc is specified' do
|
2092
|
-
|
2093
|
-
let(:new_show_disk_loc) do
|
2094
|
-
false
|
2095
|
-
end
|
2096
|
-
|
2097
|
-
it 'sets the show_disk_loc value' do
|
2098
|
-
new_view = view.show_disk_loc(new_show_disk_loc)
|
2099
|
-
expect(new_view.show_disk_loc).to eq(new_show_disk_loc)
|
2100
|
-
end
|
2101
|
-
|
2102
|
-
it 'returns a new View' do
|
2103
|
-
expect(view.show_disk_loc(new_show_disk_loc)).not_to be(view)
|
2104
|
-
end
|
2105
|
-
end
|
2106
|
-
|
2107
|
-
context 'when show_disk_loc is not specified' do
|
2108
|
-
|
2109
|
-
it 'returns the show_disk_loc value' do
|
2110
|
-
expect(view.show_disk_loc).to eq(options[:show_disk_loc])
|
2111
|
-
end
|
2112
|
-
end
|
2113
|
-
end
|
2114
|
-
|
2115
|
-
describe '#modifiers' do
|
2116
|
-
|
2117
|
-
let(:options) do
|
2118
|
-
{ :modifiers => { '$orderby' => 1 } }
|
2119
|
-
end
|
2120
|
-
|
2121
|
-
context 'when a modifiers document is specified' do
|
2122
|
-
|
2123
|
-
let(:new_modifiers) do
|
2124
|
-
{ '$orderby' => -1 }
|
2125
|
-
end
|
2126
|
-
|
2127
|
-
it 'sets the new_modifiers document' do
|
2128
|
-
new_view = view.modifiers(new_modifiers)
|
2129
|
-
expect(new_view.modifiers).to eq(new_modifiers)
|
2130
|
-
end
|
2131
|
-
|
2132
|
-
it 'returns a new View' do
|
2133
|
-
expect(view.modifiers(new_modifiers)).not_to be(view)
|
2134
|
-
end
|
2135
|
-
end
|
2136
|
-
|
2137
|
-
context 'when a modifiers document is not specified' do
|
2138
|
-
|
2139
|
-
it 'returns the modifiers value' do
|
2140
|
-
expect(view.modifiers).to eq(options[:modifiers])
|
2141
|
-
end
|
2142
|
-
end
|
2143
|
-
end
|
2144
|
-
|
2145
|
-
describe '#max_time_ms' do
|
2146
|
-
|
2147
|
-
let(:options) do
|
2148
|
-
{ :max_time_ms => 200 }
|
2149
|
-
end
|
2150
|
-
|
2151
|
-
context 'when max_time_ms is specified' do
|
2152
|
-
|
2153
|
-
let(:new_max_time_ms) do
|
2154
|
-
300
|
2155
|
-
end
|
2156
|
-
|
2157
|
-
it 'sets the max_time_ms value' do
|
2158
|
-
new_view = view.max_time_ms(new_max_time_ms)
|
2159
|
-
expect(new_view.max_time_ms).to eq(new_max_time_ms)
|
2160
|
-
end
|
2161
|
-
|
2162
|
-
it 'returns a new View' do
|
2163
|
-
expect(view.max_time_ms(new_max_time_ms)).not_to be(view)
|
2164
|
-
end
|
2165
|
-
end
|
2166
|
-
|
2167
|
-
context 'when max_time_ms is not specified' do
|
2168
|
-
|
2169
|
-
it 'returns the max_time_ms value' do
|
2170
|
-
expect(view.max_time_ms).to eq(options[:max_time_ms])
|
2171
|
-
end
|
2172
|
-
end
|
2173
|
-
end
|
2174
|
-
|
2175
|
-
describe '#cusor_type' do
|
2176
|
-
|
2177
|
-
let(:options) do
|
2178
|
-
{ :cursor_type => :tailable }
|
2179
|
-
end
|
2180
|
-
|
2181
|
-
context 'when cursor_type is specified' do
|
2182
|
-
|
2183
|
-
let(:new_cursor_type) do
|
2184
|
-
:tailable_await
|
2185
|
-
end
|
2186
|
-
|
2187
|
-
it 'sets the cursor_type value' do
|
2188
|
-
new_view = view.cursor_type(new_cursor_type)
|
2189
|
-
expect(new_view.cursor_type).to eq(new_cursor_type)
|
2190
|
-
end
|
2191
|
-
|
2192
|
-
it 'returns a new View' do
|
2193
|
-
expect(view.cursor_type(new_cursor_type)).not_to be(view)
|
2194
|
-
end
|
2195
|
-
end
|
2196
|
-
|
2197
|
-
context 'when cursor_type is not specified' do
|
2198
|
-
|
2199
|
-
it 'returns the cursor_type value' do
|
2200
|
-
expect(view.cursor_type).to eq(options[:cursor_type])
|
2201
|
-
end
|
2202
|
-
end
|
2203
|
-
end
|
2204
|
-
|
2205
|
-
describe '#skip' do
|
2206
|
-
|
2207
|
-
context 'when a skip is specified' do
|
2208
|
-
|
2209
|
-
let(:options) do
|
2210
|
-
{ :skip => 5 }
|
2211
|
-
end
|
2212
|
-
|
2213
|
-
let(:new_skip) do
|
2214
|
-
10
|
2215
|
-
end
|
2216
|
-
|
2217
|
-
it 'sets the skip value' do
|
2218
|
-
new_view = view.skip(new_skip)
|
2219
|
-
expect(new_view.skip).to eq(new_skip)
|
2220
|
-
end
|
2221
|
-
|
2222
|
-
it 'returns a new View' do
|
2223
|
-
expect(view.skip(new_skip)).not_to be(view)
|
2224
|
-
end
|
2225
|
-
end
|
2226
|
-
|
2227
|
-
context 'when a skip is not specified' do
|
2228
|
-
|
2229
|
-
let(:options) do
|
2230
|
-
{ :skip => 5 }
|
2231
|
-
end
|
2232
|
-
|
2233
|
-
it 'returns the skip value' do
|
2234
|
-
expect(view.skip).to eq(options[:skip])
|
2235
|
-
end
|
2236
|
-
end
|
2237
|
-
end
|
2238
|
-
|
2239
|
-
describe '#snapshot' do
|
2240
|
-
|
2241
|
-
let(:new_view) do
|
2242
|
-
view.snapshot(true)
|
2243
|
-
end
|
2244
|
-
|
2245
|
-
it 'sets the value in the options' do
|
2246
|
-
expect(new_view.snapshot).to be true
|
2247
|
-
end
|
2248
|
-
end
|
2249
|
-
|
2250
|
-
describe '#sort' do
|
2251
|
-
|
2252
|
-
context 'when a sort is specified' do
|
2253
|
-
|
2254
|
-
let(:options) do
|
2255
|
-
{ :sort => { 'x' => Mongo::Index::ASCENDING }}
|
2256
|
-
end
|
2257
|
-
|
2258
|
-
let(:new_sort) do
|
2259
|
-
{ 'x' => Mongo::Index::DESCENDING }
|
2260
|
-
end
|
2261
|
-
|
2262
|
-
it 'sets the sort option' do
|
2263
|
-
new_view = view.sort(new_sort)
|
2264
|
-
expect(new_view.sort).to eq(new_sort)
|
2265
|
-
end
|
2266
|
-
|
2267
|
-
it 'returns a new View' do
|
2268
|
-
expect(view.sort(new_sort)).not_to be(view)
|
2269
|
-
end
|
2270
|
-
end
|
2271
|
-
|
2272
|
-
context 'when a sort is not specified' do
|
2273
|
-
|
2274
|
-
let(:options) do
|
2275
|
-
{ :sort => { 'x' => Mongo::Index::ASCENDING }}
|
2276
|
-
end
|
2277
|
-
|
2278
|
-
it 'returns the sort' do
|
2279
|
-
expect(view.sort).to eq(options[:sort])
|
2280
|
-
end
|
2281
|
-
end
|
2282
|
-
end
|
2283
|
-
end
|