mongo 2.22.0 → 2.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/mongo_console +0 -1
- data/lib/mongo/active_support.rb +1 -2
- data/lib/mongo/address/ipv4.rb +3 -6
- data/lib/mongo/address/ipv6.rb +6 -10
- data/lib/mongo/address/unix.rb +1 -4
- data/lib/mongo/address/validator.rb +16 -28
- data/lib/mongo/address.rb +30 -40
- data/lib/mongo/auth/aws/conversation.rb +6 -10
- data/lib/mongo/auth/aws/credentials.rb +0 -1
- data/lib/mongo/auth/aws/credentials_cache.rb +0 -1
- data/lib/mongo/auth/aws/credentials_retriever.rb +45 -59
- data/lib/mongo/auth/aws/request.rb +20 -35
- data/lib/mongo/auth/aws.rb +1 -2
- data/lib/mongo/auth/base.rb +20 -29
- data/lib/mongo/auth/conversation_base.rb +14 -18
- data/lib/mongo/auth/cr/conversation.rb +0 -3
- data/lib/mongo/auth/cr.rb +1 -4
- data/lib/mongo/auth/credential_cache.rb +0 -2
- data/lib/mongo/auth/gssapi/conversation.rb +3 -8
- data/lib/mongo/auth/gssapi.rb +1 -4
- data/lib/mongo/auth/ldap/conversation.rb +0 -3
- data/lib/mongo/auth/ldap.rb +1 -4
- data/lib/mongo/auth/roles.rb +16 -19
- data/lib/mongo/auth/sasl_conversation_base.rb +7 -11
- data/lib/mongo/auth/scram/conversation.rb +2 -5
- data/lib/mongo/auth/scram.rb +5 -10
- data/lib/mongo/auth/scram256/conversation.rb +2 -5
- data/lib/mongo/auth/scram256.rb +1 -3
- data/lib/mongo/auth/scram_conversation_base.rb +18 -24
- data/lib/mongo/auth/stringprep/profiles/sasl.rb +17 -18
- data/lib/mongo/auth/stringprep/tables.rb +2209 -2210
- data/lib/mongo/auth/stringprep/unicode_normalize/normalize.rb +36 -38
- data/lib/mongo/auth/stringprep/unicode_normalize/tables.rb +1142 -1150
- data/lib/mongo/auth/stringprep.rb +9 -12
- data/lib/mongo/auth/user/view.rb +3 -5
- data/lib/mongo/auth/user.rb +14 -24
- data/lib/mongo/auth/x509/conversation.rb +0 -3
- data/lib/mongo/auth/x509.rb +7 -9
- data/lib/mongo/auth.rb +18 -30
- data/lib/mongo/background_thread.rb +9 -17
- data/lib/mongo/bson.rb +0 -2
- data/lib/mongo/bulk_write/combineable.rb +0 -3
- data/lib/mongo/bulk_write/ordered_combiner.rb +1 -3
- data/lib/mongo/bulk_write/result.rb +11 -16
- data/lib/mongo/bulk_write/result_combiner.rb +9 -12
- data/lib/mongo/bulk_write/transformable.rb +16 -19
- data/lib/mongo/bulk_write/unordered_combiner.rb +1 -3
- data/lib/mongo/bulk_write/validatable.rb +11 -18
- data/lib/mongo/bulk_write.rb +76 -91
- data/lib/mongo/caching_cursor.rb +2 -7
- data/lib/mongo/client.rb +267 -276
- data/lib/mongo/client_encryption.rb +4 -5
- data/lib/mongo/cluster/periodic_executor.rb +2 -5
- data/lib/mongo/cluster/reapers/cursor_reaper.rb +21 -29
- data/lib/mongo/cluster/reapers/socket_reaper.rb +1 -6
- data/lib/mongo/cluster/sdam_flow.rb +136 -159
- data/lib/mongo/cluster/topology/base.rb +15 -18
- data/lib/mongo/cluster/topology/load_balanced.rb +24 -14
- data/lib/mongo/cluster/topology/no_replica_set_options.rb +3 -6
- data/lib/mongo/cluster/topology/replica_set_no_primary.rb +20 -23
- data/lib/mongo/cluster/topology/replica_set_with_primary.rb +0 -2
- data/lib/mongo/cluster/topology/sharded.rb +19 -9
- data/lib/mongo/cluster/topology/single.rb +24 -14
- data/lib/mongo/cluster/topology/unknown.rb +20 -10
- data/lib/mongo/cluster/topology.rb +29 -25
- data/lib/mongo/cluster.rb +152 -184
- data/lib/mongo/cluster_time.rb +14 -31
- data/lib/mongo/collection/helpers.rb +5 -8
- data/lib/mongo/collection/view/aggregation/behavior.rb +1 -1
- data/lib/mongo/collection/view/aggregation.rb +10 -12
- data/lib/mongo/collection/view/builder/aggregation.rb +6 -9
- data/lib/mongo/collection/view/builder/map_reduce.rb +18 -17
- data/lib/mongo/collection/view/builder.rb +0 -1
- data/lib/mongo/collection/view/change_stream/retryable.rb +3 -8
- data/lib/mongo/collection/view/change_stream.rb +59 -58
- data/lib/mongo/collection/view/explainable.rb +11 -20
- data/lib/mongo/collection/view/immutable.rb +1 -3
- data/lib/mongo/collection/view/iterable.rb +44 -35
- data/lib/mongo/collection/view/map_reduce.rb +20 -25
- data/lib/mongo/collection/view/readable.rb +96 -94
- data/lib/mongo/collection/view/writable.rb +104 -114
- data/lib/mongo/collection/view.rb +11 -8
- data/lib/mongo/collection.rb +103 -106
- data/lib/mongo/condition_variable.rb +4 -4
- data/lib/mongo/config/options.rb +0 -3
- data/lib/mongo/config/validators/option.rb +3 -5
- data/lib/mongo/config.rb +6 -4
- data/lib/mongo/crypt/auto_decryption_context.rb +9 -3
- data/lib/mongo/crypt/auto_encrypter.rb +34 -43
- data/lib/mongo/crypt/auto_encryption_context.rb +0 -3
- data/lib/mongo/crypt/binary.rb +5 -9
- data/lib/mongo/crypt/binding.rb +150 -156
- data/lib/mongo/crypt/context.rb +20 -17
- data/lib/mongo/crypt/data_key_context.rb +2 -7
- data/lib/mongo/crypt/encryption_io.rb +29 -39
- data/lib/mongo/crypt/explicit_decryption_context.rb +9 -3
- data/lib/mongo/crypt/explicit_encrypter.rb +1 -1
- data/lib/mongo/crypt/explicit_encryption_context.rb +19 -30
- data/lib/mongo/crypt/explicit_encryption_expression_context.rb +0 -2
- data/lib/mongo/crypt/handle.rb +42 -48
- data/lib/mongo/crypt/hooks.rb +12 -15
- data/lib/mongo/crypt/kms/aws/credentials.rb +12 -16
- data/lib/mongo/crypt/kms/aws/master_document.rb +6 -9
- data/lib/mongo/crypt/kms/aws.rb +0 -2
- data/lib/mongo/crypt/kms/azure/credentials_retriever.rb +2 -7
- data/lib/mongo/crypt/kms/azure/master_document.rb +15 -19
- data/lib/mongo/crypt/kms/azure.rb +0 -1
- data/lib/mongo/crypt/kms/credentials.rb +13 -27
- data/lib/mongo/crypt/kms/gcp/credentials.rb +12 -14
- data/lib/mongo/crypt/kms/gcp/credentials_retriever.rb +7 -9
- data/lib/mongo/crypt/kms/gcp/master_document.rb +12 -16
- data/lib/mongo/crypt/kms/gcp.rb +0 -2
- data/lib/mongo/crypt/kms/kmip/credentials.rb +7 -8
- data/lib/mongo/crypt/kms/kmip/master_document.rb +3 -5
- data/lib/mongo/crypt/kms/kmip.rb +0 -1
- data/lib/mongo/crypt/kms/local/credentials.rb +7 -8
- data/lib/mongo/crypt/kms/local/master_document.rb +2 -6
- data/lib/mongo/crypt/kms/local.rb +0 -1
- data/lib/mongo/crypt/kms/master_key_document.rb +11 -15
- data/lib/mongo/crypt/kms.rb +14 -16
- data/lib/mongo/crypt/kms_context.rb +0 -2
- data/lib/mongo/crypt/rewrap_many_data_key_context.rb +2 -7
- data/lib/mongo/crypt/rewrap_many_data_key_result.rb +2 -4
- data/lib/mongo/crypt/status.rb +12 -14
- data/lib/mongo/crypt.rb +0 -1
- data/lib/mongo/csot_timeout_holder.rb +3 -2
- data/lib/mongo/cursor/kill_spec.rb +7 -10
- data/lib/mongo/cursor.rb +74 -64
- data/lib/mongo/cursor_host.rb +8 -10
- data/lib/mongo/database/view.rb +23 -39
- data/lib/mongo/database.rb +68 -65
- data/lib/mongo/dbref.rb +0 -1
- data/lib/mongo/deprecations.rb +98 -0
- data/lib/mongo/distinguishing_semaphore.rb +0 -1
- data/lib/mongo/error/auth_error.rb +0 -2
- data/lib/mongo/error/bad_load_balancer_target.rb +0 -2
- data/lib/mongo/error/bulk_write_error.rb +7 -10
- data/lib/mongo/error/change_stream_resumable.rb +0 -2
- data/lib/mongo/error/client_closed.rb +0 -2
- data/lib/mongo/error/closed_stream.rb +1 -4
- data/lib/mongo/error/connection_check_out_timeout.rb +3 -6
- data/lib/mongo/error/connection_perished.rb +0 -2
- data/lib/mongo/error/connection_unavailable.rb +0 -2
- data/lib/mongo/error/credential_check_error.rb +0 -2
- data/lib/mongo/error/crypt_error.rb +0 -2
- data/lib/mongo/error/extra_file_chunk.rb +1 -4
- data/lib/mongo/error/failed_string_prep_validation.rb +5 -6
- data/lib/mongo/error/file_not_found.rb +0 -3
- data/lib/mongo/error/handshake_error.rb +0 -2
- data/lib/mongo/error/insufficient_iteration_count.rb +1 -4
- data/lib/mongo/error/internal_driver_error.rb +0 -2
- data/lib/mongo/error/invalid_address.rb +0 -2
- data/lib/mongo/error/invalid_application_name.rb +0 -3
- data/lib/mongo/error/invalid_bulk_operation.rb +1 -4
- data/lib/mongo/error/invalid_bulk_operation_type.rb +1 -4
- data/lib/mongo/error/invalid_collection_name.rb +1 -4
- data/lib/mongo/error/invalid_config_option.rb +0 -3
- data/lib/mongo/error/invalid_cursor_operation.rb +0 -2
- data/lib/mongo/error/invalid_database_name.rb +1 -4
- data/lib/mongo/error/invalid_document.rb +1 -4
- data/lib/mongo/error/invalid_file.rb +0 -3
- data/lib/mongo/error/invalid_file_revision.rb +0 -3
- data/lib/mongo/error/invalid_min_pool_size.rb +0 -3
- data/lib/mongo/error/invalid_nonce.rb +0 -3
- data/lib/mongo/error/invalid_read_concern.rb +2 -4
- data/lib/mongo/error/invalid_read_option.rb +0 -3
- data/lib/mongo/error/invalid_replacement_document.rb +2 -5
- data/lib/mongo/error/invalid_server_auth_host.rb +0 -2
- data/lib/mongo/error/invalid_server_auth_response.rb +0 -2
- data/lib/mongo/error/invalid_server_preference.rb +7 -16
- data/lib/mongo/error/invalid_session.rb +1 -4
- data/lib/mongo/error/invalid_signature.rb +0 -3
- data/lib/mongo/error/invalid_transaction_operation.rb +5 -8
- data/lib/mongo/error/invalid_txt_record.rb +0 -2
- data/lib/mongo/error/invalid_update_document.rb +2 -5
- data/lib/mongo/error/invalid_uri.rb +1 -4
- data/lib/mongo/error/invalid_write_concern.rb +2 -5
- data/lib/mongo/error/kms_error.rb +0 -2
- data/lib/mongo/error/labelable.rb +0 -3
- data/lib/mongo/error/lint_error.rb +0 -2
- data/lib/mongo/error/max_bson_size.rb +8 -11
- data/lib/mongo/error/max_message_size.rb +2 -5
- data/lib/mongo/error/mismatched_domain.rb +0 -2
- data/lib/mongo/error/missing_connection.rb +0 -2
- data/lib/mongo/error/missing_file_chunk.rb +0 -3
- data/lib/mongo/error/missing_password.rb +0 -2
- data/lib/mongo/error/missing_resume_token.rb +1 -4
- data/lib/mongo/error/missing_scram_server_signature.rb +2 -4
- data/lib/mongo/error/missing_service_id.rb +0 -2
- data/lib/mongo/error/mongocryptd_spawn_error.rb +0 -2
- data/lib/mongo/error/multi_index_drop.rb +0 -3
- data/lib/mongo/error/need_primary_server.rb +0 -2
- data/lib/mongo/error/no_server_available.rb +3 -8
- data/lib/mongo/error/no_service_connection_available.rb +1 -3
- data/lib/mongo/error/no_srv_records.rb +0 -2
- data/lib/mongo/error/notable.rb +8 -16
- data/lib/mongo/error/operation_failure.rb +22 -35
- data/lib/mongo/error/parser.rb +33 -75
- data/lib/mongo/error/pool_cleared_error.rb +1 -3
- data/lib/mongo/error/pool_closed_error.rb +0 -3
- data/lib/mongo/error/pool_error.rb +0 -3
- data/lib/mongo/error/pool_paused_error.rb +0 -2
- data/lib/mongo/error/raise_original_error.rb +1 -3
- data/lib/mongo/error/read_write_retryable.rb +14 -17
- data/lib/mongo/error/sdam_error_detection.rb +3 -5
- data/lib/mongo/error/server_api_conflict.rb +0 -2
- data/lib/mongo/error/server_certificate_revoked.rb +0 -2
- data/lib/mongo/error/server_not_usable.rb +0 -2
- data/lib/mongo/error/session_ended.rb +1 -3
- data/lib/mongo/error/session_not_materialized.rb +1 -3
- data/lib/mongo/error/sessions_not_supported.rb +1 -4
- data/lib/mongo/error/snapshot_session_invalid_server_version.rb +1 -4
- data/lib/mongo/error/snapshot_session_transaction_prohibited.rb +1 -4
- data/lib/mongo/error/socket_error.rb +0 -2
- data/lib/mongo/error/socket_timeout_error.rb +0 -2
- data/lib/mongo/error/transactions_not_supported.rb +3 -6
- data/lib/mongo/error/unchangeable_collection_option.rb +1 -4
- data/lib/mongo/error/unexpected_chunk_length.rb +0 -3
- data/lib/mongo/error/unexpected_response.rb +1 -4
- data/lib/mongo/error/unknown_payload_type.rb +0 -3
- data/lib/mongo/error/unmet_dependency.rb +0 -2
- data/lib/mongo/error/unsupported_array_filters.rb +3 -24
- data/lib/mongo/error/unsupported_collation.rb +3 -24
- data/lib/mongo/error/unsupported_features.rb +0 -2
- data/lib/mongo/error/unsupported_message_type.rb +0 -2
- data/lib/mongo/error/unsupported_option.rb +19 -21
- data/lib/mongo/error/write_retryable.rb +0 -2
- data/lib/mongo/error.rb +10 -24
- data/lib/mongo/event/base.rb +0 -2
- data/lib/mongo/event/listeners.rb +0 -3
- data/lib/mongo/event/publisher.rb +0 -3
- data/lib/mongo/event/subscriber.rb +0 -4
- data/lib/mongo/event.rb +4 -6
- data/lib/mongo/grid/file/chunk.rb +7 -10
- data/lib/mongo/grid/file/info.rb +20 -24
- data/lib/mongo/grid/file.rb +7 -8
- data/lib/mongo/grid/fs_bucket.rb +40 -48
- data/lib/mongo/grid/stream/read.rb +25 -35
- data/lib/mongo/grid/stream/write.rb +17 -22
- data/lib/mongo/grid/stream.rb +2 -4
- data/lib/mongo/grid.rb +0 -1
- data/lib/mongo/id.rb +0 -1
- data/lib/mongo/index/view.rb +68 -58
- data/lib/mongo/index.rb +7 -10
- data/lib/mongo/lint.rb +31 -37
- data/lib/mongo/loggable.rb +5 -8
- data/lib/mongo/logger.rb +1 -7
- data/lib/mongo/monitoring/cmap_log_subscriber.rb +0 -2
- data/lib/mongo/monitoring/command_log_subscriber.rb +25 -33
- data/lib/mongo/monitoring/event/cmap/base.rb +0 -2
- data/lib/mongo/monitoring/event/cmap/connection_check_out_failed.rb +1 -4
- data/lib/mongo/monitoring/event/cmap/connection_check_out_started.rb +0 -3
- data/lib/mongo/monitoring/event/cmap/connection_checked_in.rb +1 -4
- data/lib/mongo/monitoring/event/cmap/connection_checked_out.rb +2 -5
- data/lib/mongo/monitoring/event/cmap/connection_closed.rb +1 -4
- data/lib/mongo/monitoring/event/cmap/connection_created.rb +1 -4
- data/lib/mongo/monitoring/event/cmap/connection_ready.rb +1 -4
- data/lib/mongo/monitoring/event/cmap/pool_cleared.rb +0 -3
- data/lib/mongo/monitoring/event/cmap/pool_closed.rb +1 -4
- data/lib/mongo/monitoring/event/cmap/pool_created.rb +1 -4
- data/lib/mongo/monitoring/event/cmap/pool_ready.rb +1 -4
- data/lib/mongo/monitoring/event/cmap.rb +0 -1
- data/lib/mongo/monitoring/event/command_failed.rb +5 -9
- data/lib/mongo/monitoring/event/command_started.rb +8 -12
- data/lib/mongo/monitoring/event/command_succeeded.rb +7 -15
- data/lib/mongo/monitoring/event/secure.rb +15 -20
- data/lib/mongo/monitoring/event/server_closed.rb +1 -4
- data/lib/mongo/monitoring/event/server_description_changed.rb +4 -8
- data/lib/mongo/monitoring/event/server_heartbeat_failed.rb +5 -10
- data/lib/mongo/monitoring/event/server_heartbeat_started.rb +1 -4
- data/lib/mongo/monitoring/event/server_heartbeat_succeeded.rb +3 -8
- data/lib/mongo/monitoring/event/server_opening.rb +1 -4
- data/lib/mongo/monitoring/event/topology_changed.rb +2 -5
- data/lib/mongo/monitoring/event/topology_closed.rb +1 -4
- data/lib/mongo/monitoring/event/topology_opening.rb +1 -4
- data/lib/mongo/monitoring/event.rb +0 -1
- data/lib/mongo/monitoring/publishable.rb +20 -30
- data/lib/mongo/monitoring/sdam_log_subscriber.rb +0 -2
- data/lib/mongo/monitoring/server_closed_log_subscriber.rb +0 -3
- data/lib/mongo/monitoring/server_description_changed_log_subscriber.rb +0 -3
- data/lib/mongo/monitoring/server_opening_log_subscriber.rb +0 -3
- data/lib/mongo/monitoring/topology_changed_log_subscriber.rb +5 -8
- data/lib/mongo/monitoring/topology_closed_log_subscriber.rb +0 -3
- data/lib/mongo/monitoring/topology_opening_log_subscriber.rb +0 -3
- data/lib/mongo/monitoring/unified_sdam_log_subscriber.rb +1 -3
- data/lib/mongo/monitoring.rb +38 -39
- data/lib/mongo/operation/aggregate/op_msg.rb +0 -2
- data/lib/mongo/operation/aggregate/result.rb +3 -6
- data/lib/mongo/operation/aggregate.rb +0 -2
- data/lib/mongo/operation/collections_info/result.rb +0 -3
- data/lib/mongo/operation/collections_info.rb +0 -2
- data/lib/mongo/operation/command/op_msg.rb +1 -4
- data/lib/mongo/operation/command.rb +0 -2
- data/lib/mongo/operation/context.rb +13 -16
- data/lib/mongo/operation/count/op_msg.rb +2 -4
- data/lib/mongo/operation/count.rb +0 -2
- data/lib/mongo/operation/create/op_msg.rb +2 -5
- data/lib/mongo/operation/create.rb +4 -2
- data/lib/mongo/operation/create_index/op_msg.rb +3 -7
- data/lib/mongo/operation/create_index.rb +0 -2
- data/lib/mongo/operation/create_user/op_msg.rb +2 -4
- data/lib/mongo/operation/create_user.rb +0 -2
- data/lib/mongo/operation/delete/bulk_result.rb +2 -3
- data/lib/mongo/operation/delete/op_msg.rb +3 -10
- data/lib/mongo/operation/delete/result.rb +0 -3
- data/lib/mongo/operation/delete.rb +1 -5
- data/lib/mongo/operation/distinct/op_msg.rb +2 -5
- data/lib/mongo/operation/distinct.rb +0 -2
- data/lib/mongo/operation/drop/op_msg.rb +0 -2
- data/lib/mongo/operation/drop.rb +0 -2
- data/lib/mongo/operation/drop_database/op_msg.rb +0 -2
- data/lib/mongo/operation/drop_database.rb +0 -2
- data/lib/mongo/operation/drop_index/op_msg.rb +4 -6
- data/lib/mongo/operation/drop_index.rb +0 -2
- data/lib/mongo/operation/explain/op_msg.rb +0 -2
- data/lib/mongo/operation/explain/result.rb +0 -3
- data/lib/mongo/operation/explain.rb +0 -2
- data/lib/mongo/operation/find/builder/command.rb +4 -12
- data/lib/mongo/operation/find/builder/flags.rb +9 -15
- data/lib/mongo/operation/find/builder/modifiers.rb +1 -4
- data/lib/mongo/operation/find/builder.rb +0 -1
- data/lib/mongo/operation/find/op_msg.rb +4 -12
- data/lib/mongo/operation/find/result.rb +0 -3
- data/lib/mongo/operation/find.rb +0 -2
- data/lib/mongo/operation/get_more/command_builder.rb +1 -6
- data/lib/mongo/operation/get_more/op_msg.rb +10 -4
- data/lib/mongo/operation/get_more/result.rb +0 -3
- data/lib/mongo/operation/get_more.rb +0 -2
- data/lib/mongo/operation/indexes/op_msg.rb +0 -2
- data/lib/mongo/operation/indexes/result.rb +1 -5
- data/lib/mongo/operation/indexes.rb +0 -2
- data/lib/mongo/operation/insert/bulk_result.rb +2 -6
- data/lib/mongo/operation/insert/op_msg.rb +7 -6
- data/lib/mongo/operation/insert/result.rb +0 -3
- data/lib/mongo/operation/insert.rb +2 -5
- data/lib/mongo/operation/kill_cursors/command_builder.rb +0 -3
- data/lib/mongo/operation/kill_cursors/op_msg.rb +1 -3
- data/lib/mongo/operation/kill_cursors.rb +0 -2
- data/lib/mongo/operation/list_collections/op_msg.rb +4 -6
- data/lib/mongo/operation/list_collections/result.rb +1 -4
- data/lib/mongo/operation/list_collections.rb +0 -2
- data/lib/mongo/operation/map_reduce/op_msg.rb +0 -2
- data/lib/mongo/operation/map_reduce/result.rb +3 -6
- data/lib/mongo/operation/map_reduce.rb +0 -2
- data/lib/mongo/operation/op_msg_base.rb +0 -1
- data/lib/mongo/operation/parallel_scan/op_msg.rb +4 -5
- data/lib/mongo/operation/parallel_scan/result.rb +2 -5
- data/lib/mongo/operation/parallel_scan.rb +0 -2
- data/lib/mongo/operation/remove_user/op_msg.rb +2 -4
- data/lib/mongo/operation/remove_user.rb +0 -2
- data/lib/mongo/operation/result.rb +38 -48
- data/lib/mongo/operation/shared/bypass_document_validation.rb +3 -7
- data/lib/mongo/operation/shared/causal_consistency_supported.rb +0 -3
- data/lib/mongo/operation/shared/executable.rb +29 -31
- data/lib/mongo/operation/shared/executable_no_validate.rb +0 -3
- data/lib/mongo/operation/shared/executable_transaction_label.rb +0 -2
- data/lib/mongo/operation/shared/idable.rb +3 -6
- data/lib/mongo/operation/shared/limited.rb +0 -3
- data/lib/mongo/operation/shared/object_id_generator.rb +0 -3
- data/lib/mongo/operation/shared/op_msg_executable.rb +0 -2
- data/lib/mongo/operation/shared/polymorphic_lookup.rb +0 -2
- data/lib/mongo/operation/shared/polymorphic_result.rb +2 -4
- data/lib/mongo/operation/shared/read_preference_supported.rb +10 -15
- data/lib/mongo/operation/shared/response_handling.rb +13 -26
- data/lib/mongo/operation/shared/result/aggregatable.rb +12 -13
- data/lib/mongo/operation/shared/sessions_supported.rb +87 -99
- data/lib/mongo/operation/shared/specifiable.rb +37 -59
- data/lib/mongo/operation/shared/write.rb +12 -17
- data/lib/mongo/operation/shared/write_concern_supported.rb +4 -7
- data/lib/mongo/operation/update/bulk_result.rb +13 -17
- data/lib/mongo/operation/update/op_msg.rb +2 -5
- data/lib/mongo/operation/update/result.rb +5 -5
- data/lib/mongo/operation/update.rb +1 -5
- data/lib/mongo/operation/update_user/op_msg.rb +2 -4
- data/lib/mongo/operation/update_user.rb +0 -2
- data/lib/mongo/operation/users_info/op_msg.rb +2 -4
- data/lib/mongo/operation/users_info/result.rb +1 -4
- data/lib/mongo/operation/users_info.rb +0 -2
- data/lib/mongo/operation/write_command/op_msg.rb +2 -10
- data/lib/mongo/operation/write_command.rb +0 -2
- data/lib/mongo/operation.rb +9 -14
- data/lib/mongo/options/mapper.rb +8 -15
- data/lib/mongo/options/redacted.rb +7 -9
- data/lib/mongo/options.rb +0 -1
- data/lib/mongo/protocol/bit_vector.rb +3 -5
- data/lib/mongo/protocol/caching_hash.rb +2 -7
- data/lib/mongo/protocol/compressed.rb +5 -10
- data/lib/mongo/protocol/get_more.rb +2 -8
- data/lib/mongo/protocol/kill_cursors.rb +2 -8
- data/lib/mongo/protocol/message.rb +103 -105
- data/lib/mongo/protocol/msg.rb +48 -63
- data/lib/mongo/protocol/query.rb +32 -41
- data/lib/mongo/protocol/registry.rb +2 -5
- data/lib/mongo/protocol/reply.rb +10 -16
- data/lib/mongo/protocol/serializers.rb +41 -59
- data/lib/mongo/protocol.rb +0 -1
- data/lib/mongo/query_cache.rb +7 -15
- data/lib/mongo/retryable/backpressure.rb +31 -0
- data/lib/mongo/retryable/base_worker.rb +39 -13
- data/lib/mongo/retryable/read_worker.rb +77 -21
- data/lib/mongo/retryable/retry_policy.rb +59 -0
- data/lib/mongo/retryable/write_worker.rb +155 -56
- data/lib/mongo/retryable.rb +70 -9
- data/lib/mongo/search_index/view.rb +30 -10
- data/lib/mongo/semaphore.rb +0 -1
- data/lib/mongo/server/app_metadata/environment.rb +3 -3
- data/lib/mongo/server/app_metadata/platform.rb +17 -4
- data/lib/mongo/server/app_metadata.rb +4 -5
- data/lib/mongo/server/connection.rb +79 -61
- data/lib/mongo/server/connection_base.rb +43 -53
- data/lib/mongo/server/connection_common.rb +41 -64
- data/lib/mongo/server/connection_pool/generation_manager.rb +6 -11
- data/lib/mongo/server/connection_pool/populator.rb +1 -4
- data/lib/mongo/server/connection_pool.rb +195 -167
- data/lib/mongo/server/description/features.rb +51 -59
- data/lib/mongo/server/description/load_balancer.rb +0 -2
- data/lib/mongo/server/description.rb +117 -138
- data/lib/mongo/server/monitor/app_metadata.rb +3 -4
- data/lib/mongo/server/monitor/connection.rb +28 -35
- data/lib/mongo/server/monitor.rb +65 -60
- data/lib/mongo/server/pending_connection.rb +70 -71
- data/lib/mongo/server/push_monitor/connection.rb +0 -3
- data/lib/mongo/server/push_monitor.rb +21 -29
- data/lib/mongo/server/round_trip_time_calculator.rb +11 -17
- data/lib/mongo/server.rb +62 -94
- data/lib/mongo/server_selector/base.rb +133 -157
- data/lib/mongo/server_selector/nearest.rb +2 -5
- data/lib/mongo/server_selector/primary.rb +1 -5
- data/lib/mongo/server_selector/primary_preferred.rb +2 -6
- data/lib/mongo/server_selector/secondary.rb +2 -6
- data/lib/mongo/server_selector/secondary_preferred.rb +1 -5
- data/lib/mongo/server_selector.rb +3 -4
- data/lib/mongo/session/server_session.rb +6 -7
- data/lib/mongo/session/session_pool.rb +20 -34
- data/lib/mongo/session.rb +334 -199
- data/lib/mongo/socket/ocsp_cache.rb +8 -13
- data/lib/mongo/socket/ocsp_verifier.rb +69 -70
- data/lib/mongo/socket/ssl.rb +44 -43
- data/lib/mongo/socket/tcp.rb +5 -8
- data/lib/mongo/socket/unix.rb +0 -4
- data/lib/mongo/socket.rb +80 -102
- data/lib/mongo/srv/monitor.rb +10 -11
- data/lib/mongo/srv/resolver.rb +15 -24
- data/lib/mongo/srv/result.rb +25 -21
- data/lib/mongo/srv.rb +0 -1
- data/lib/mongo/timeout.rb +4 -11
- data/lib/mongo/topology_version.rb +8 -13
- data/lib/mongo/tracing/open_telemetry/command_tracer.rb +320 -0
- data/lib/mongo/tracing/open_telemetry/operation_tracer.rb +227 -0
- data/lib/mongo/tracing/open_telemetry/tracer.rb +236 -0
- data/lib/mongo/{error/server_api_not_supported.rb → tracing/open_telemetry.rb} +10 -10
- data/lib/mongo/tracing.rb +42 -0
- data/lib/mongo/uri/options_mapper.rb +135 -126
- data/lib/mongo/uri/srv_protocol.rb +34 -42
- data/lib/mongo/uri.rb +95 -139
- data/lib/mongo/utils.rb +5 -12
- data/lib/mongo/version.rb +1 -1
- data/lib/mongo/write_concern/acknowledged.rb +0 -2
- data/lib/mongo/write_concern/base.rb +6 -6
- data/lib/mongo/write_concern/unacknowledged.rb +0 -2
- data/lib/mongo/write_concern.rb +14 -15
- data/lib/mongo.rb +4 -3
- data/mongo.gemspec +17 -17
- metadata +11 -5
- data/lib/mongo/operation/shared/result/use_legacy_error_parser.rb +0 -32
- data/lib/mongo/operation/shared/validatable.rb +0 -87
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
module Mongo
|
|
5
4
|
class Error
|
|
6
5
|
# This exception is raised when stringprep validation fails, such as due to
|
|
7
|
-
# character being present or
|
|
6
|
+
# character being present or bidirectional data being invalid.
|
|
8
7
|
#
|
|
9
8
|
# @since 2.6.0
|
|
10
9
|
class FailedStringPrepValidation < Error
|
|
11
10
|
# The error message describing failed bidi validation.
|
|
12
11
|
#
|
|
13
12
|
# @since 2.6.0
|
|
14
|
-
INVALID_BIDIRECTIONAL = 'Data failed bidirectional validation'
|
|
13
|
+
INVALID_BIDIRECTIONAL = 'Data failed bidirectional validation'
|
|
15
14
|
|
|
16
15
|
# The error message describing the discovery of a prohibited character.
|
|
17
16
|
#
|
|
18
17
|
# @since 2.6.0
|
|
19
|
-
PROHIBITED_CHARACTER = 'Data contains a prohibited character.'
|
|
18
|
+
PROHIBITED_CHARACTER = 'Data contains a prohibited character.'
|
|
20
19
|
|
|
21
20
|
# The error message describing that stringprep normalization can't be done on Ruby versions
|
|
22
21
|
# below 2.2.0.
|
|
23
22
|
#
|
|
24
23
|
# @since 2.6.0
|
|
25
|
-
UNABLE_TO_NORMALIZE = 'Unable to perform normalization with Ruby versions below 2.2.0'
|
|
24
|
+
UNABLE_TO_NORMALIZE = 'Unable to perform normalization with Ruby versions below 2.2.0'
|
|
26
25
|
|
|
27
26
|
# Create the new exception.
|
|
28
27
|
#
|
|
@@ -34,7 +33,7 @@ module Mongo
|
|
|
34
33
|
#
|
|
35
34
|
# @since 2.6.0
|
|
36
35
|
def initialize(msg)
|
|
37
|
-
super
|
|
36
|
+
super
|
|
38
37
|
end
|
|
39
38
|
end
|
|
40
39
|
end
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2014-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,12 +16,10 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# Raised if a file is deleted from a GridFS but it is not found.
|
|
22
20
|
#
|
|
23
21
|
# @since 2.1.0
|
|
24
22
|
class FileNotFound < Error
|
|
25
|
-
|
|
26
23
|
# Create the new exception.
|
|
27
24
|
#
|
|
28
25
|
# @example Create the new exception.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2014-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,12 +16,10 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# Exception that is raised when trying to create a database with no name.
|
|
22
20
|
#
|
|
23
21
|
# @since 2.6.0
|
|
24
22
|
class InsufficientIterationCount < Error
|
|
25
|
-
|
|
26
23
|
# Instantiate the new exception.
|
|
27
24
|
#
|
|
28
25
|
# @example Instantiate the exception.
|
|
@@ -30,7 +27,7 @@ module Mongo
|
|
|
30
27
|
#
|
|
31
28
|
# @since 2.6.0
|
|
32
29
|
def initialize(msg)
|
|
33
|
-
super
|
|
30
|
+
super
|
|
34
31
|
end
|
|
35
32
|
|
|
36
33
|
def self.message(required_count, given_count)
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2021 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,7 +16,6 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# Raised when the driver detects an internal implementation problem.
|
|
22
20
|
class InternalDriverError < Error
|
|
23
21
|
end
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2016-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,13 +16,11 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# This exception is raised when the metadata document sent to the server
|
|
22
20
|
# at the time of a connection handshake is invalid.
|
|
23
21
|
#
|
|
24
22
|
# @since 2.4.0
|
|
25
23
|
class InvalidApplicationName < Error
|
|
26
|
-
|
|
27
24
|
# Instantiate the new exception.
|
|
28
25
|
#
|
|
29
26
|
# @example Create the exception.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2014-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,12 +16,10 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
|
-
# Exception raised if an non-existent operation type is used.
|
|
19
|
+
# Exception raised if a non-existent operation type is used.
|
|
22
20
|
#
|
|
23
21
|
# @since 2.0.0
|
|
24
22
|
class InvalidBulkOperation < Error
|
|
25
|
-
|
|
26
23
|
# Instantiate the new exception.
|
|
27
24
|
#
|
|
28
25
|
# @example Instantiate the exception.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2014-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,12 +16,10 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
|
-
# Exception raised if an non-existent operation type is used.
|
|
19
|
+
# Exception raised if a non-existent operation type is used.
|
|
22
20
|
#
|
|
23
21
|
# @since 2.0.0
|
|
24
22
|
class InvalidBulkOperationType < Error
|
|
25
|
-
|
|
26
23
|
# Instantiate the new exception.
|
|
27
24
|
#
|
|
28
25
|
# @example Instantiate the exception.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2014-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,16 +16,14 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# Exception that is raised when trying to create a collection with no name.
|
|
22
20
|
#
|
|
23
21
|
# @since 2.0.0
|
|
24
22
|
class InvalidCollectionName < Error
|
|
25
|
-
|
|
26
23
|
# The message is constant.
|
|
27
24
|
#
|
|
28
25
|
# @since 2.0.0
|
|
29
|
-
MESSAGE = 'nil is an invalid collection name. Please provide a string or symbol.'
|
|
26
|
+
MESSAGE = 'nil is an invalid collection name. Please provide a string or symbol.'
|
|
30
27
|
|
|
31
28
|
# Instantiate the new exception.
|
|
32
29
|
#
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
module Mongo
|
|
5
4
|
class Error
|
|
6
|
-
|
|
7
5
|
# This error is raised when a bad configuration option is attempted to be
|
|
8
6
|
# set.
|
|
9
7
|
class InvalidConfigOption < Error
|
|
10
|
-
|
|
11
8
|
# Create the new error.
|
|
12
9
|
#
|
|
13
10
|
# @param [ Symbol, String ] name The attempted config option name.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2014-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,16 +16,14 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# Exception that is raised when trying to create a database with no name.
|
|
22
20
|
#
|
|
23
21
|
# @since 2.0.0
|
|
24
22
|
class InvalidDatabaseName < Error
|
|
25
|
-
|
|
26
23
|
# The message is constant.
|
|
27
24
|
#
|
|
28
25
|
# @since 2.0.0
|
|
29
|
-
MESSAGE = 'nil is an invalid database name. Please provide a string or symbol.'
|
|
26
|
+
MESSAGE = 'nil is an invalid database name. Please provide a string or symbol.'
|
|
30
27
|
|
|
31
28
|
# Instantiate the new exception.
|
|
32
29
|
#
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2014-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,16 +16,14 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# Exception raised if the object is not a valid document.
|
|
22
20
|
#
|
|
23
21
|
# @since 2.0.0
|
|
24
22
|
class InvalidDocument < Error
|
|
25
|
-
|
|
26
23
|
# The error message.
|
|
27
24
|
#
|
|
28
25
|
# @since 2.0.0
|
|
29
|
-
MESSAGE = 'Invalid document provided.'
|
|
26
|
+
MESSAGE = 'Invalid document provided.'
|
|
30
27
|
|
|
31
28
|
# Instantiate the new exception.
|
|
32
29
|
#
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2014-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,13 +16,11 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# Raised if the file md5 and server md5 do not match when acknowledging
|
|
22
20
|
# GridFS writes.
|
|
23
21
|
#
|
|
24
22
|
# @since 2.0.0
|
|
25
23
|
class InvalidFile < Error
|
|
26
|
-
|
|
27
24
|
# Create the new exception.
|
|
28
25
|
#
|
|
29
26
|
# @example Create the new exception.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2014-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,12 +16,10 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# Raised if the requested file revision is not found.
|
|
22
20
|
#
|
|
23
21
|
# @since 2.1.0
|
|
24
22
|
class InvalidFileRevision < Error
|
|
25
|
-
|
|
26
23
|
# Create the new exception.
|
|
27
24
|
#
|
|
28
25
|
# @example Create the new exception.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2014-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,13 +16,11 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# Exception that is raised when trying to create a client with an invalid
|
|
22
20
|
# min_pool_size option.
|
|
23
21
|
#
|
|
24
22
|
# @since 2.4.2
|
|
25
23
|
class InvalidMinPoolSize < Error
|
|
26
|
-
|
|
27
24
|
# Instantiate the new exception.
|
|
28
25
|
#
|
|
29
26
|
# @example Instantiate the exception.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2015-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,13 +16,11 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# This exception is raised when the server nonce returned does not
|
|
22
20
|
# start with the client nonce sent to it.
|
|
23
21
|
#
|
|
24
22
|
# @since 2.0.0
|
|
25
23
|
class InvalidNonce < Error
|
|
26
|
-
|
|
27
24
|
# @return [ String ] nonce The client nonce.
|
|
28
25
|
attr_reader :nonce
|
|
29
26
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,14 +16,13 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# Raised when an invalid read concern is provided.
|
|
22
20
|
class InvalidReadConcern < Error
|
|
23
21
|
# Instantiate the new exception.
|
|
24
22
|
def initialize(msg = nil)
|
|
25
23
|
super(msg || 'Invalid read concern option provided.' \
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
'The only valid key is :level, for which accepted values are' \
|
|
25
|
+
':local, :majority, and :snapshot')
|
|
28
26
|
end
|
|
29
27
|
end
|
|
30
28
|
end
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2018-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,13 +16,11 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# Exception that is raised when trying to create a client with an invalid
|
|
22
20
|
# read option.
|
|
23
21
|
#
|
|
24
22
|
# @since 2.6.0
|
|
25
23
|
class InvalidReadOption < Error
|
|
26
|
-
|
|
27
24
|
# Instantiate the new exception.
|
|
28
25
|
#
|
|
29
26
|
# @example Instantiate the exception.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2014-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,14 +16,12 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# Exception raised if the object is not a valid replacement document.
|
|
22
20
|
class InvalidReplacementDocument < Error
|
|
23
|
-
|
|
24
21
|
# The error message.
|
|
25
22
|
#
|
|
26
23
|
# @deprecated
|
|
27
|
-
MESSAGE = 'Invalid replacement document provided'
|
|
24
|
+
MESSAGE = 'Invalid replacement document provided'
|
|
28
25
|
|
|
29
26
|
# Construct the error message.
|
|
30
27
|
#
|
|
@@ -34,7 +31,7 @@ module Mongo
|
|
|
34
31
|
#
|
|
35
32
|
# @api private
|
|
36
33
|
def self.message(key)
|
|
37
|
-
message =
|
|
34
|
+
message = 'Invalid replacement document provided. Replacement documents '
|
|
38
35
|
message += "must not contain atomic modifiers. The \"#{key}\" key is invalid."
|
|
39
36
|
message
|
|
40
37
|
end
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,7 +16,6 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# Raised when the server returned an invalid Host value in AWS auth.
|
|
22
20
|
class InvalidServerAuthHost < InvalidServerAuthResponse
|
|
23
21
|
end
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,7 +16,6 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# Raised when authentication is aborted on the client because the server
|
|
22
20
|
# responded in an unacceptable manner.
|
|
23
21
|
class InvalidServerAuthResponse < AuthError
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2014-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,40 +16,32 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# Raised when an invalid server preference is provided.
|
|
22
20
|
#
|
|
23
21
|
# @since 2.0.0
|
|
24
22
|
class InvalidServerPreference < Error
|
|
25
|
-
|
|
26
23
|
# Error message when tags are specified for a read preference that cannot support them.
|
|
27
24
|
#
|
|
28
25
|
# @since 2.4.0
|
|
29
|
-
NO_TAG_SUPPORT = 'This read preference cannot be combined with tags.'
|
|
26
|
+
NO_TAG_SUPPORT = 'This read preference cannot be combined with tags.'
|
|
30
27
|
|
|
31
28
|
# Error message when a max staleness is specified for a read preference that cannot support it.
|
|
32
29
|
#
|
|
33
30
|
# @since 2.4.0
|
|
34
|
-
NO_MAX_STALENESS_SUPPORT = 'max_staleness cannot be set for this read preference.'
|
|
31
|
+
NO_MAX_STALENESS_SUPPORT = 'max_staleness cannot be set for this read preference.'
|
|
35
32
|
|
|
36
33
|
# Error message when hedge is specified for a read preference that does not support it.
|
|
37
34
|
#
|
|
38
35
|
# @api private
|
|
39
|
-
NO_HEDGE_SUPPORT = 'The hedge option cannot be set for this read preference'
|
|
36
|
+
NO_HEDGE_SUPPORT = 'The hedge option cannot be set for this read preference'
|
|
40
37
|
|
|
41
38
|
# Error message for when the max staleness is not at least twice the heartbeat frequency.
|
|
42
39
|
#
|
|
43
40
|
# @since 2.4.0
|
|
44
41
|
# @deprecated
|
|
45
|
-
INVALID_MAX_STALENESS =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
# Error message when max staleness cannot be used because one or more servers has version < 3.4.
|
|
50
|
-
#
|
|
51
|
-
# @since 2.4.0
|
|
52
|
-
NO_MAX_STALENESS_WITH_LEGACY_SERVER = 'max_staleness can only be set for a cluster in which ' +
|
|
53
|
-
'each server is at least version 3.4.'.freeze
|
|
42
|
+
INVALID_MAX_STALENESS = '`max_staleness` value is too small. It must be at least ' +
|
|
43
|
+
"`ServerSelector::SMALLEST_MAX_STALENESS_SECONDS` and (the cluster's heartbeat_frequency " +
|
|
44
|
+
'setting + `Cluster::IDLE_WRITE_PERIOD_SECONDS`).'
|
|
54
45
|
|
|
55
46
|
# Instantiate the new exception.
|
|
56
47
|
#
|
|
@@ -61,7 +52,7 @@ module Mongo
|
|
|
61
52
|
#
|
|
62
53
|
# @since 2.0.0
|
|
63
54
|
def initialize(message)
|
|
64
|
-
super
|
|
55
|
+
super
|
|
65
56
|
end
|
|
66
57
|
end
|
|
67
58
|
end
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2017-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,13 +16,11 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# This exception is raised when a session is attempted to be used and it
|
|
22
20
|
# is invalid.
|
|
23
21
|
#
|
|
24
22
|
# @since 2.5.0
|
|
25
23
|
class InvalidSession < Error
|
|
26
|
-
|
|
27
24
|
# Create the new exception.
|
|
28
25
|
#
|
|
29
26
|
# @example Create the new exception.
|
|
@@ -33,7 +30,7 @@ module Mongo
|
|
|
33
30
|
#
|
|
34
31
|
# @since 2.5.0
|
|
35
32
|
def initialize(message)
|
|
36
|
-
super
|
|
33
|
+
super
|
|
37
34
|
end
|
|
38
35
|
end
|
|
39
36
|
end
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2015-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,13 +16,11 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# This exception is raised when the server verifier does not match the
|
|
22
20
|
# expected signature on the client.
|
|
23
21
|
#
|
|
24
22
|
# @since 2.0.0
|
|
25
23
|
class InvalidSignature < Error
|
|
26
|
-
|
|
27
24
|
# @return [ String ] verifier The server verifier string.
|
|
28
25
|
attr_reader :verifier
|
|
29
26
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2014-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,33 +16,31 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# Exception raised if an invalid operation is attempted as part of a transaction.
|
|
22
20
|
#
|
|
23
21
|
# @since 2.6.0
|
|
24
22
|
class InvalidTransactionOperation < Error
|
|
25
|
-
|
|
26
23
|
# The error message for when a user attempts to commit or abort a transaction when none is in
|
|
27
24
|
# progress.
|
|
28
25
|
#
|
|
29
26
|
# @since 2.6.0
|
|
30
|
-
NO_TRANSACTION_STARTED = 'no transaction started'
|
|
27
|
+
NO_TRANSACTION_STARTED = 'no transaction started'
|
|
31
28
|
|
|
32
29
|
# The error message for when a user attempts to start a transaction when one is already in
|
|
33
30
|
# progress.
|
|
34
31
|
#
|
|
35
32
|
# @since 2.6.0.
|
|
36
|
-
TRANSACTION_ALREADY_IN_PROGRESS = 'transaction already in progress'
|
|
33
|
+
TRANSACTION_ALREADY_IN_PROGRESS = 'transaction already in progress'
|
|
37
34
|
|
|
38
35
|
# The error message for when a transaction read operation uses a non-primary read preference.
|
|
39
36
|
#
|
|
40
37
|
# @since 2.6.0
|
|
41
|
-
INVALID_READ_PREFERENCE = 'read preference in a transaction must be primary'
|
|
38
|
+
INVALID_READ_PREFERENCE = 'read preference in a transaction must be primary'
|
|
42
39
|
|
|
43
40
|
# The error message for when a transaction is started with an unacknowledged write concern.
|
|
44
41
|
#
|
|
45
42
|
# @since 2.6.0
|
|
46
|
-
UNACKNOWLEDGED_WRITE_CONCERN = 'transactions do not support unacknowledged write concern'
|
|
43
|
+
UNACKNOWLEDGED_WRITE_CONCERN = 'transactions do not support unacknowledged write concern'
|
|
47
44
|
|
|
48
45
|
# Instantiate the new exception.
|
|
49
46
|
#
|
|
@@ -52,7 +49,7 @@ module Mongo
|
|
|
52
49
|
#
|
|
53
50
|
# @since 2.6.0
|
|
54
51
|
def initialize(msg)
|
|
55
|
-
super
|
|
52
|
+
super
|
|
56
53
|
end
|
|
57
54
|
|
|
58
55
|
# Create an error message for incorrectly running a transaction operation twice.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
2
|
|
|
4
3
|
# Copyright (C) 2017-2020 MongoDB Inc.
|
|
5
4
|
#
|
|
@@ -17,7 +16,6 @@
|
|
|
17
16
|
|
|
18
17
|
module Mongo
|
|
19
18
|
class Error
|
|
20
|
-
|
|
21
19
|
# This exception is raised when the URI Parser's query returns too many
|
|
22
20
|
# TXT records or the record specifies invalid options.
|
|
23
21
|
#
|