mongo 2.5.3 → 2.6.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 +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/LICENSE +1 -1
- data/README.md +3 -2
- data/lib/mongo.rb +2 -2
- data/lib/mongo/address.rb +10 -2
- data/lib/mongo/address/ipv4.rb +1 -1
- data/lib/mongo/address/ipv6.rb +26 -5
- data/lib/mongo/address/unix.rb +1 -1
- data/lib/mongo/auth.rb +10 -3
- data/lib/mongo/auth/cr.rb +4 -1
- data/lib/mongo/auth/cr/conversation.rb +4 -1
- data/lib/mongo/auth/ldap.rb +1 -1
- data/lib/mongo/auth/ldap/conversation.rb +1 -1
- data/lib/mongo/auth/roles.rb +1 -1
- data/lib/mongo/auth/scram.rb +24 -7
- data/lib/mongo/auth/scram/conversation.rb +52 -19
- data/lib/mongo/auth/stringprep.rb +114 -0
- data/lib/mongo/auth/stringprep/profiles/sasl.rb +73 -0
- data/lib/mongo/auth/stringprep/tables.rb +3232 -0
- data/lib/mongo/auth/stringprep/unicode_normalize/normalize.rb +174 -0
- data/lib/mongo/auth/stringprep/unicode_normalize/tables.rb +1170 -0
- data/lib/mongo/auth/user.rb +14 -3
- data/lib/mongo/auth/user/view.rb +1 -1
- data/lib/mongo/auth/x509.rb +1 -1
- data/lib/mongo/auth/x509/conversation.rb +1 -1
- data/lib/mongo/bson.rb +1 -1
- data/lib/mongo/bulk_write.rb +8 -8
- data/lib/mongo/bulk_write/combineable.rb +1 -1
- data/lib/mongo/bulk_write/ordered_combiner.rb +1 -1
- data/lib/mongo/bulk_write/result.rb +1 -1
- data/lib/mongo/bulk_write/result_combiner.rb +4 -4
- data/lib/mongo/bulk_write/transformable.rb +1 -1
- data/lib/mongo/bulk_write/unordered_combiner.rb +1 -1
- data/lib/mongo/bulk_write/validatable.rb +1 -1
- data/lib/mongo/client.rb +115 -24
- data/lib/mongo/cluster.rb +17 -10
- data/lib/mongo/cluster/app_metadata.rb +7 -1
- data/lib/mongo/cluster/periodic_executor.rb +1 -1
- data/lib/mongo/cluster/reapers/socket_reaper.rb +1 -1
- data/lib/mongo/cluster/topology.rb +12 -2
- data/lib/mongo/cluster/topology/replica_set.rb +9 -1
- data/lib/mongo/cluster/topology/sharded.rb +1 -1
- data/lib/mongo/cluster/topology/single.rb +1 -1
- data/lib/mongo/cluster/topology/unknown.rb +1 -1
- data/lib/mongo/collection.rb +75 -19
- data/lib/mongo/collection/view.rb +1 -1
- data/lib/mongo/collection/view/aggregation.rb +1 -1
- data/lib/mongo/collection/view/builder.rb +1 -1
- data/lib/mongo/collection/view/builder/aggregation.rb +3 -3
- data/lib/mongo/collection/view/builder/find_command.rb +1 -1
- data/lib/mongo/collection/view/builder/flags.rb +1 -1
- data/lib/mongo/collection/view/builder/map_reduce.rb +1 -1
- data/lib/mongo/collection/view/builder/modifiers.rb +1 -1
- data/lib/mongo/collection/view/builder/op_query.rb +1 -1
- data/lib/mongo/collection/view/change_stream.rb +193 -17
- data/lib/mongo/collection/view/change_stream/retryable.rb +3 -20
- data/lib/mongo/collection/view/explainable.rb +1 -1
- data/lib/mongo/collection/view/immutable.rb +1 -1
- data/lib/mongo/collection/view/iterable.rb +2 -2
- data/lib/mongo/collection/view/map_reduce.rb +1 -1
- data/lib/mongo/collection/view/readable.rb +108 -29
- data/lib/mongo/collection/view/writable.rb +3 -3
- data/lib/mongo/cursor.rb +44 -4
- data/lib/mongo/cursor/builder.rb +1 -1
- data/lib/mongo/cursor/builder/get_more_command.rb +1 -1
- data/lib/mongo/cursor/builder/kill_cursors_command.rb +1 -1
- data/lib/mongo/cursor/builder/op_get_more.rb +1 -1
- data/lib/mongo/cursor/builder/op_kill_cursors.rb +1 -1
- data/lib/mongo/database.rb +46 -3
- data/lib/mongo/database/view.rb +11 -11
- data/lib/mongo/dbref.rb +1 -1
- data/lib/mongo/error.rb +57 -1
- data/lib/mongo/error/bulk_write_error.rb +2 -2
- data/lib/mongo/error/change_stream_resumable.rb +37 -0
- data/lib/mongo/error/closed_stream.rb +1 -1
- data/lib/mongo/error/extra_file_chunk.rb +1 -1
- data/lib/mongo/error/failed_stringprep_validation.rb +38 -0
- data/lib/mongo/error/file_not_found.rb +1 -1
- data/lib/mongo/error/insufficient_iteration_count.rb +38 -0
- data/lib/mongo/error/invalid_application_name.rb +1 -1
- data/lib/mongo/error/invalid_bulk_operation.rb +1 -1
- data/lib/mongo/error/invalid_bulk_operation_type.rb +1 -1
- data/lib/mongo/error/invalid_collection_name.rb +1 -1
- data/lib/mongo/error/invalid_database_name.rb +1 -1
- data/lib/mongo/error/invalid_document.rb +1 -1
- data/lib/mongo/error/invalid_file.rb +1 -1
- data/lib/mongo/error/invalid_file_revision.rb +1 -1
- data/lib/mongo/error/invalid_min_pool_size.rb +1 -1
- data/lib/mongo/error/invalid_nonce.rb +1 -1
- data/lib/mongo/error/invalid_read_option.rb +35 -0
- data/lib/mongo/error/invalid_replacement_document.rb +1 -1
- data/lib/mongo/error/invalid_server_preference.rb +1 -1
- data/lib/mongo/error/invalid_session.rb +1 -1
- data/lib/mongo/error/invalid_signature.rb +1 -1
- data/lib/mongo/error/invalid_transaction_operation.rb +82 -0
- data/lib/mongo/error/invalid_txt_record.rb +1 -1
- data/lib/mongo/error/invalid_update_document.rb +1 -1
- data/lib/mongo/error/invalid_uri.rb +1 -1
- data/lib/mongo/error/invalid_write_concern.rb +1 -1
- data/lib/mongo/error/max_bson_size.rb +1 -1
- data/lib/mongo/error/max_message_size.rb +1 -1
- data/lib/mongo/error/mismatched_domain.rb +1 -1
- data/lib/mongo/error/missing_file_chunk.rb +1 -1
- data/lib/mongo/error/missing_resume_token.rb +1 -1
- data/lib/mongo/error/multi_index_drop.rb +1 -1
- data/lib/mongo/error/need_primary_server.rb +1 -1
- data/lib/mongo/error/no_server_available.rb +1 -1
- data/lib/mongo/error/no_srv_records.rb +1 -1
- data/lib/mongo/error/operation_failure.rb +108 -14
- data/lib/mongo/error/parser.rb +50 -1
- data/lib/mongo/error/socket_error.rb +5 -2
- data/lib/mongo/error/socket_timeout_error.rb +5 -2
- data/lib/mongo/error/unchangeable_collection_option.rb +1 -1
- data/lib/mongo/error/unexpected_chunk_length.rb +1 -1
- data/lib/mongo/error/unexpected_response.rb +1 -1
- data/lib/mongo/error/unknown_payload_type.rb +1 -1
- data/lib/mongo/error/unsupported_array_filters.rb +1 -1
- data/lib/mongo/error/unsupported_collation.rb +1 -1
- data/lib/mongo/error/unsupported_features.rb +1 -1
- data/lib/mongo/error/unsupported_message_type.rb +1 -1
- data/lib/mongo/error/write_retryable.rb +27 -0
- data/lib/mongo/event.rb +10 -9
- data/lib/mongo/event/base.rb +33 -0
- data/lib/mongo/event/description_changed.rb +2 -2
- data/lib/mongo/event/listeners.rb +1 -1
- data/lib/mongo/event/member_discovered.rb +4 -2
- data/lib/mongo/event/primary_elected.rb +2 -2
- data/lib/mongo/event/publisher.rb +1 -1
- data/lib/mongo/event/standalone_discovered.rb +2 -2
- data/lib/mongo/event/subscriber.rb +1 -1
- data/lib/mongo/grid.rb +1 -1
- data/lib/mongo/grid/file.rb +1 -1
- data/lib/mongo/grid/file/chunk.rb +3 -3
- data/lib/mongo/grid/file/info.rb +26 -3
- data/lib/mongo/grid/fs_bucket.rb +1 -1
- data/lib/mongo/grid/stream.rb +1 -1
- data/lib/mongo/grid/stream/read.rb +1 -1
- data/lib/mongo/grid/stream/write.rb +1 -1
- data/lib/mongo/index.rb +1 -1
- data/lib/mongo/index/view.rb +1 -1
- data/lib/mongo/loggable.rb +1 -1
- data/lib/mongo/logger.rb +1 -1
- data/lib/mongo/monitoring.rb +99 -62
- data/lib/mongo/monitoring/command_log_subscriber.rb +2 -2
- data/lib/mongo/monitoring/event.rb +2 -1
- data/lib/mongo/monitoring/event/command_failed.rb +19 -6
- data/lib/mongo/monitoring/event/command_started.rb +14 -3
- data/lib/mongo/monitoring/event/command_succeeded.rb +5 -3
- data/lib/mongo/monitoring/event/secure.rb +1 -1
- data/lib/mongo/monitoring/event/server_closed.rb +2 -2
- data/lib/mongo/monitoring/event/server_description_changed.rb +2 -2
- data/lib/mongo/monitoring/event/server_opening.rb +11 -2
- data/lib/mongo/monitoring/event/topology_changed.rb +13 -2
- data/lib/mongo/monitoring/event/topology_closed.rb +2 -2
- data/lib/mongo/monitoring/event/topology_opening.rb +11 -2
- data/lib/mongo/monitoring/publishable.rb +10 -6
- data/lib/mongo/monitoring/sdam_log_subscriber.rb +1 -1
- data/lib/mongo/monitoring/server_closed_log_subscriber.rb +1 -1
- data/lib/mongo/monitoring/server_description_changed_log_subscriber.rb +1 -1
- data/lib/mongo/monitoring/server_opening_log_subscriber.rb +1 -1
- data/lib/mongo/monitoring/topology_changed_log_subscriber.rb +1 -1
- data/lib/mongo/monitoring/topology_opening_log_subscriber.rb +1 -1
- data/lib/mongo/operation/aggregate/op_msg.rb +3 -0
- data/lib/mongo/operation/create/op_msg.rb +9 -0
- data/lib/mongo/operation/create_index/op_msg.rb +9 -0
- data/lib/mongo/operation/create_user/command.rb +1 -1
- data/lib/mongo/operation/create_user/op_msg.rb +10 -1
- data/lib/mongo/operation/delete/op_msg.rb +3 -0
- data/lib/mongo/operation/distinct/op_msg.rb +9 -0
- data/lib/mongo/operation/drop/op_msg.rb +9 -0
- data/lib/mongo/operation/drop_database/op_msg.rb +9 -0
- data/lib/mongo/operation/drop_index/op_msg.rb +9 -0
- data/lib/mongo/operation/explain/op_msg.rb +3 -0
- data/lib/mongo/operation/find/op_msg.rb +3 -0
- data/lib/mongo/operation/get_more.rb +1 -1
- data/lib/mongo/operation/get_more/command.rb +1 -1
- data/lib/mongo/operation/get_more/legacy.rb +1 -1
- data/lib/mongo/operation/get_more/op_msg.rb +3 -0
- data/lib/mongo/operation/indexes/op_msg.rb +3 -0
- data/lib/mongo/operation/indexes/result.rb +1 -1
- data/lib/mongo/operation/insert/bulk_result.rb +32 -2
- data/lib/mongo/operation/insert/op_msg.rb +3 -0
- data/lib/mongo/operation/insert/result.rb +1 -1
- data/lib/mongo/operation/kill_cursors/op_msg.rb +9 -0
- data/lib/mongo/operation/list_collections/op_msg.rb +3 -0
- data/lib/mongo/operation/list_collections/result.rb +5 -1
- data/lib/mongo/operation/map_reduce/op_msg.rb +3 -0
- data/lib/mongo/operation/map_reduce/result.rb +1 -1
- data/lib/mongo/operation/parallel_scan/op_msg.rb +3 -0
- data/lib/mongo/operation/remove_user/op_msg.rb +9 -0
- data/lib/mongo/operation/result.rb +27 -14
- data/lib/mongo/operation/shared/executable.rb +1 -0
- data/lib/mongo/operation/shared/sessions_supported.rb +78 -7
- data/lib/mongo/operation/shared/specifiable.rb +18 -2
- data/lib/mongo/operation/shared/write_concern_supported.rb +1 -1
- data/lib/mongo/operation/update/op_msg.rb +3 -0
- data/lib/mongo/operation/update_user/command.rb +1 -1
- data/lib/mongo/operation/update_user/op_msg.rb +10 -1
- data/lib/mongo/operation/users_info/op_msg.rb +3 -0
- data/lib/mongo/options.rb +1 -1
- data/lib/mongo/options/mapper.rb +1 -1
- data/lib/mongo/options/redacted.rb +1 -1
- data/lib/mongo/protocol/bit_vector.rb +1 -1
- data/lib/mongo/protocol/compressed.rb +1 -1
- data/lib/mongo/protocol/delete.rb +1 -1
- data/lib/mongo/protocol/get_more.rb +7 -7
- data/lib/mongo/protocol/insert.rb +1 -1
- data/lib/mongo/protocol/kill_cursors.rb +1 -1
- data/lib/mongo/protocol/message.rb +5 -5
- data/lib/mongo/protocol/msg.rb +9 -7
- data/lib/mongo/protocol/query.rb +1 -1
- data/lib/mongo/protocol/registry.rb +1 -1
- data/lib/mongo/protocol/reply.rb +10 -10
- data/lib/mongo/protocol/serializers.rb +1 -1
- data/lib/mongo/protocol/update.rb +1 -1
- data/lib/mongo/retryable.rb +22 -14
- data/lib/mongo/server.rb +1 -1
- data/lib/mongo/server/connectable.rb +1 -1
- data/lib/mongo/server/connection.rb +16 -4
- data/lib/mongo/server/connection_pool.rb +1 -1
- data/lib/mongo/server/connection_pool/queue.rb +1 -1
- data/lib/mongo/server/context.rb +1 -1
- data/lib/mongo/server/description.rb +14 -2
- data/lib/mongo/server/description/features.rb +10 -9
- data/lib/mongo/server/description/inspector.rb +1 -1
- data/lib/mongo/server/description/inspector/description_changed.rb +1 -1
- data/lib/mongo/server/description/inspector/member_discovered.rb +1 -1
- data/lib/mongo/server/description/inspector/primary_elected.rb +1 -1
- data/lib/mongo/server/description/inspector/standalone_discovered.rb +1 -1
- data/lib/mongo/server/monitor.rb +15 -3
- data/lib/mongo/server/monitor/connection.rb +1 -1
- data/lib/mongo/server_selector.rb +1 -1
- data/lib/mongo/server_selector/nearest.rb +1 -1
- data/lib/mongo/server_selector/primary.rb +1 -1
- data/lib/mongo/server_selector/primary_preferred.rb +1 -1
- data/lib/mongo/server_selector/secondary.rb +1 -1
- data/lib/mongo/server_selector/secondary_preferred.rb +1 -1
- data/lib/mongo/server_selector/selectable.rb +7 -2
- data/lib/mongo/session.rb +389 -12
- data/lib/mongo/session/server_session.rb +7 -2
- data/lib/mongo/session/session_pool.rb +1 -1
- data/lib/mongo/socket.rb +1 -1
- data/lib/mongo/socket/ssl.rb +1 -1
- data/lib/mongo/socket/tcp.rb +1 -1
- data/lib/mongo/socket/unix.rb +1 -1
- data/lib/mongo/uri.rb +6 -4
- data/lib/mongo/uri/srv_protocol.rb +1 -1
- data/lib/mongo/version.rb +2 -2
- data/lib/mongo/write_concern.rb +1 -1
- data/lib/mongo/write_concern/acknowledged.rb +1 -1
- data/lib/mongo/write_concern/normalizable.rb +1 -1
- data/lib/mongo/write_concern/unacknowledged.rb +1 -1
- data/mongo.gemspec +4 -1
- data/spec/atlas/atlas_connectivity_spec.rb +54 -0
- data/spec/integration/bulk_insert_spec.rb +78 -0
- data/spec/integration/change_stream_spec.rb +365 -0
- data/spec/integration/command_monitoring_spec.rb +92 -0
- data/spec/lite_spec_helper.rb +63 -0
- data/spec/mongo/address/ipv6_spec.rb +29 -1
- data/spec/mongo/address_spec.rb +34 -0
- data/spec/mongo/auth/scram/conversation_spec.rb +326 -120
- data/spec/mongo/auth/scram/negotiation_spec.rb +574 -0
- data/spec/mongo/auth/scram_spec.rb +107 -38
- data/spec/mongo/auth/stringprep/profiles/sasl_spec.rb +113 -0
- data/spec/mongo/auth/stringprep_spec.rb +188 -0
- data/spec/mongo/auth/user/view_spec.rb +5 -2
- data/spec/mongo/auth/user_spec.rb +1 -1
- data/spec/mongo/bulk_write/result_spec.rb +120 -0
- data/spec/mongo/bulk_write_spec.rb +42 -2
- data/spec/mongo/client_spec.rb +121 -9
- data/spec/mongo/cluster/app_metadata_spec.rb +14 -1
- data/spec/mongo/cluster/topology_spec.rb +1 -23
- data/spec/mongo/collection/view/change_stream_spec.rb +62 -180
- data/spec/mongo/collection_spec.rb +45 -12
- data/spec/mongo/cursor/builder/get_more_command_spec.rb +7 -7
- data/spec/mongo/cursor_spec.rb +2 -2
- data/spec/mongo/database_spec.rb +3 -3
- data/spec/mongo/docs_examples_spec.rb +194 -0
- data/spec/mongo/error/operation_failure_spec.rb +152 -0
- data/spec/mongo/error/parser_spec.rb +127 -0
- data/spec/mongo/grid/fs_bucket_spec.rb +32 -0
- data/spec/mongo/grid/stream/write_spec.rb +40 -1
- data/spec/mongo/monitoring/event/command_failed_spec.rb +30 -0
- data/spec/mongo/monitoring/event/command_started_spec.rb +26 -4
- data/spec/mongo/monitoring/event/command_succeeded_spec.rb +29 -7
- data/spec/mongo/monitoring_spec.rb +28 -3
- data/spec/mongo/protocol/get_more_spec.rb +2 -2
- data/spec/mongo/retryable_spec.rb +252 -34
- data/spec/mongo/retryable_writes_spec.rb +468 -544
- data/spec/mongo/server/connection_spec.rb +5 -5
- data/spec/mongo/server/description_spec.rb +23 -6
- data/spec/mongo/session/server_session_spec.rb +2 -2
- data/spec/mongo/session/session_pool_spec.rb +2 -2
- data/spec/mongo/transactions_examples_spec.rb +227 -0
- data/spec/mongo/transactions_spec.rb +44 -0
- data/spec/spec_helper.rb +135 -49
- data/spec/spec_tests/change_streams_spec.rb +42 -0
- data/spec/{mongo → spec_tests}/command_monitoring_spec.rb +8 -2
- data/spec/{mongo → spec_tests}/connection_string_spec.rb +1 -1
- data/spec/{mongo → spec_tests}/crud_spec.rb +5 -7
- data/spec/{mongo → spec_tests}/dns_seedlist_discovery_spec.rb +1 -1
- data/spec/{mongo → spec_tests}/gridfs_spec.rb +0 -0
- data/spec/{mongo → spec_tests}/max_staleness_spec.rb +0 -0
- data/spec/spec_tests/retryable_writes_spec.rb +78 -0
- data/spec/{mongo → spec_tests}/sdam_monitoring_spec.rb +4 -3
- data/spec/{mongo → spec_tests}/sdam_spec.rb +7 -7
- data/spec/{mongo → spec_tests}/server_selection_rtt_spec.rb +0 -0
- data/spec/{mongo → spec_tests}/server_selection_spec.rb +0 -0
- data/spec/support/authorization.rb +18 -6
- data/spec/support/change_streams.rb +265 -0
- data/spec/support/change_streams/operation.rb +62 -0
- data/spec/support/change_streams_tests/change-streams-errors.yml +53 -0
- data/spec/support/change_streams_tests/change-streams.yml +299 -0
- data/spec/support/command_monitoring.rb +1 -1
- data/spec/support/command_monitoring/bulkWrite.yml +4 -28
- data/spec/support/command_monitoring/command.yml +19 -0
- data/spec/support/command_monitoring/find.yml +17 -19
- data/spec/support/command_monitoring/insertMany.yml +2 -8
- data/spec/support/command_monitoring/unacknowledgedBulkWrite.yml +34 -0
- data/spec/support/connection_string.rb +1 -1
- data/spec/support/constraints.rb +56 -0
- data/spec/support/crud.rb +9 -4
- data/spec/support/crud/read.rb +24 -3
- data/spec/support/crud/write.rb +7 -2
- data/spec/support/crud_tests/read/count-collation.yml +12 -2
- data/spec/support/crud_tests/read/count.yml +43 -5
- data/spec/support/gridfs.rb +1 -1
- data/spec/support/primary_socket.rb +21 -0
- data/spec/support/retryable_writes_tests/bulkWrite-serverErrors.yml +90 -0
- data/spec/support/retryable_writes_tests/bulkWrite.yml +99 -1
- data/spec/support/retryable_writes_tests/deleteOne-serverErrors.yml +50 -0
- data/spec/support/retryable_writes_tests/deleteOne.yml +10 -1
- data/spec/support/retryable_writes_tests/findOneAndDelete-serverErrors.yml +50 -0
- data/spec/support/retryable_writes_tests/findOneAndDelete.yml +39 -30
- data/spec/support/retryable_writes_tests/findOneAndReplace-serverErrors.yml +54 -0
- data/spec/support/retryable_writes_tests/findOneAndReplace.yml +9 -0
- data/spec/support/retryable_writes_tests/findOneAndUpdate-serverErrors.yml +54 -0
- data/spec/support/retryable_writes_tests/findOneAndUpdate.yml +9 -0
- data/spec/support/retryable_writes_tests/insertMany-serverErrors.yml +59 -0
- data/spec/support/retryable_writes_tests/insertMany.yml +11 -6
- data/spec/support/retryable_writes_tests/insertOne-serverErrors.yml +471 -0
- data/spec/support/retryable_writes_tests/insertOne.yml +9 -0
- data/spec/support/retryable_writes_tests/replaceOne-serverErrors.yml +58 -0
- data/spec/support/retryable_writes_tests/replaceOne.yml +9 -0
- data/spec/support/retryable_writes_tests/updateOne-serverErrors.yml +58 -0
- data/spec/support/retryable_writes_tests/updateOne.yml +71 -53
- data/spec/support/sdam/rs/normalize_case_me.yml +100 -0
- data/spec/support/sdam/sharded/compatible.yml +38 -0
- data/spec/support/sdam/sharded/mongos_disconnect.yml +9 -3
- data/spec/support/sdam/sharded/multiple_mongoses.yml +6 -2
- data/spec/support/sdam/sharded/non_mongos_removed.yml +6 -2
- data/spec/support/sdam/sharded/too_new.yml +36 -0
- data/spec/support/sdam/sharded/too_old.yml +36 -0
- data/spec/support/sdam/single/compatible.yml +26 -0
- data/spec/support/sdam/single/direct_connection_external_ip.yml +3 -1
- data/spec/support/sdam/single/direct_connection_mongos.yml +3 -1
- data/spec/support/sdam/single/direct_connection_rsarbiter.yml +3 -1
- data/spec/support/sdam/single/direct_connection_rsprimary.yml +3 -1
- data/spec/support/sdam/single/direct_connection_rssecondary.yml +3 -1
- data/spec/support/sdam/single/direct_connection_slave.yml +3 -1
- data/spec/support/sdam/single/direct_connection_standalone.yml +3 -1
- data/spec/support/sdam/single/not_ok_response.yml +6 -2
- data/spec/support/sdam/single/standalone_removed.yml +3 -1
- data/spec/support/sdam/single/too_new.yml +26 -0
- data/spec/support/sdam/single/too_old.yml +24 -0
- data/spec/support/shared/session.rb +107 -0
- data/spec/support/transactions.rb +391 -0
- data/spec/support/transactions/operation.rb +373 -0
- data/spec/support/transactions_tests/abort.yml +403 -0
- data/spec/support/transactions_tests/bulk.yml +267 -0
- data/spec/support/transactions_tests/causal-consistency.yml +173 -0
- data/spec/support/transactions_tests/commit.yml +593 -0
- data/spec/support/transactions_tests/delete.yml +184 -0
- data/spec/support/transactions_tests/error-labels.yml +948 -0
- data/spec/support/transactions_tests/errors.yml +125 -0
- data/spec/support/transactions_tests/findOneAndDelete.yml +126 -0
- data/spec/support/transactions_tests/findOneAndReplace.yml +140 -0
- data/spec/support/transactions_tests/findOneAndUpdate.yml +228 -0
- data/spec/support/transactions_tests/insert.yml +264 -0
- data/spec/support/transactions_tests/isolation.yml +125 -0
- data/spec/support/transactions_tests/read-pref.yml +340 -0
- data/spec/support/transactions_tests/reads.yml +298 -0
- data/spec/support/transactions_tests/retryable-abort.yml +1292 -0
- data/spec/support/transactions_tests/retryable-commit.yml +1332 -0
- data/spec/support/transactions_tests/retryable-writes.yml +208 -0
- data/spec/support/transactions_tests/run-command.yml +189 -0
- data/spec/support/transactions_tests/transaction-options.yml +877 -0
- data/spec/support/transactions_tests/update.yml +246 -0
- data/spec/support/transactions_tests/write-concern.yml +236 -0
- metadata +494 -359
- metadata.gz.sig +0 -0
- data/lib/csasl/csasl.bundle +0 -0
@@ -0,0 +1,403 @@
|
|
1
|
+
database_name: &database_name "ruby-driver"
|
2
|
+
collection_name: &collection_name "transactions-tests"
|
3
|
+
|
4
|
+
data: []
|
5
|
+
|
6
|
+
tests:
|
7
|
+
- description: abort
|
8
|
+
|
9
|
+
operations:
|
10
|
+
- name: startTransaction
|
11
|
+
object: session0
|
12
|
+
- name: insertOne
|
13
|
+
object: collection
|
14
|
+
arguments:
|
15
|
+
session: session0
|
16
|
+
document:
|
17
|
+
_id: 1
|
18
|
+
result:
|
19
|
+
insertedId: 1
|
20
|
+
- name: abortTransaction
|
21
|
+
object: session0
|
22
|
+
- name: startTransaction
|
23
|
+
object: session0
|
24
|
+
- name: insertOne
|
25
|
+
object: collection
|
26
|
+
arguments:
|
27
|
+
session: session0
|
28
|
+
document:
|
29
|
+
_id: 1
|
30
|
+
result:
|
31
|
+
insertedId: 1
|
32
|
+
- name: abortTransaction
|
33
|
+
object: session0
|
34
|
+
|
35
|
+
expectations:
|
36
|
+
- command_started_event:
|
37
|
+
command:
|
38
|
+
insert: *collection_name
|
39
|
+
documents:
|
40
|
+
- _id: 1
|
41
|
+
ordered: true
|
42
|
+
readConcern:
|
43
|
+
lsid: session0
|
44
|
+
txnNumber:
|
45
|
+
$numberLong: "1"
|
46
|
+
startTransaction: true
|
47
|
+
autocommit: false
|
48
|
+
writeConcern:
|
49
|
+
command_name: insert
|
50
|
+
database_name: *database_name
|
51
|
+
- command_started_event:
|
52
|
+
command:
|
53
|
+
abortTransaction: 1
|
54
|
+
lsid: session0
|
55
|
+
txnNumber:
|
56
|
+
"$numberLong": "1"
|
57
|
+
startTransaction:
|
58
|
+
autocommit: false
|
59
|
+
writeConcern:
|
60
|
+
command_name: abortTransaction
|
61
|
+
database_name: admin
|
62
|
+
- command_started_event:
|
63
|
+
command:
|
64
|
+
insert: *collection_name
|
65
|
+
documents:
|
66
|
+
- _id: 1
|
67
|
+
ordered: true
|
68
|
+
readConcern:
|
69
|
+
afterClusterTime: 42
|
70
|
+
lsid: session0
|
71
|
+
txnNumber:
|
72
|
+
$numberLong: "2"
|
73
|
+
startTransaction: true
|
74
|
+
autocommit: false
|
75
|
+
writeConcern:
|
76
|
+
command_name: insert
|
77
|
+
database_name: *database_name
|
78
|
+
- command_started_event:
|
79
|
+
command:
|
80
|
+
abortTransaction: 1
|
81
|
+
lsid: session0
|
82
|
+
txnNumber:
|
83
|
+
$numberLong: "2"
|
84
|
+
startTransaction:
|
85
|
+
autocommit: false
|
86
|
+
writeConcern:
|
87
|
+
command_name: abortTransaction
|
88
|
+
database_name: admin
|
89
|
+
|
90
|
+
outcome:
|
91
|
+
collection:
|
92
|
+
data: []
|
93
|
+
|
94
|
+
- description: implicit abort
|
95
|
+
|
96
|
+
operations:
|
97
|
+
# Start a transaction but don't commit - the driver calls abortTransaction
|
98
|
+
# from ClientSession.endSession().
|
99
|
+
- name: startTransaction
|
100
|
+
object: session0
|
101
|
+
- name: insertOne
|
102
|
+
object: collection
|
103
|
+
arguments:
|
104
|
+
session: session0
|
105
|
+
document:
|
106
|
+
_id: 1
|
107
|
+
result:
|
108
|
+
insertedId: 1
|
109
|
+
|
110
|
+
expectations:
|
111
|
+
- command_started_event:
|
112
|
+
command:
|
113
|
+
insert: *collection_name
|
114
|
+
documents:
|
115
|
+
- _id: 1
|
116
|
+
ordered: true
|
117
|
+
readConcern:
|
118
|
+
lsid: session0
|
119
|
+
txnNumber:
|
120
|
+
$numberLong: "1"
|
121
|
+
startTransaction: true
|
122
|
+
autocommit: false
|
123
|
+
writeConcern:
|
124
|
+
command_name: insert
|
125
|
+
database_name: *database_name
|
126
|
+
- command_started_event:
|
127
|
+
command:
|
128
|
+
abortTransaction: 1
|
129
|
+
lsid: session0
|
130
|
+
txnNumber:
|
131
|
+
$numberLong: "1"
|
132
|
+
startTransaction:
|
133
|
+
autocommit: false
|
134
|
+
writeConcern:
|
135
|
+
command_name: abortTransaction
|
136
|
+
database_name: admin
|
137
|
+
|
138
|
+
outcome:
|
139
|
+
collection:
|
140
|
+
data: []
|
141
|
+
|
142
|
+
- description: two aborts
|
143
|
+
|
144
|
+
operations:
|
145
|
+
- name: startTransaction
|
146
|
+
object: session0
|
147
|
+
- name: insertOne
|
148
|
+
object: collection
|
149
|
+
arguments:
|
150
|
+
session: session0
|
151
|
+
document:
|
152
|
+
_id: 1
|
153
|
+
result:
|
154
|
+
insertedId: 1
|
155
|
+
- name: abortTransaction
|
156
|
+
object: session0
|
157
|
+
- name: abortTransaction
|
158
|
+
object: session0
|
159
|
+
result:
|
160
|
+
errorContains: cannot call abortTransaction twice
|
161
|
+
|
162
|
+
expectations:
|
163
|
+
- command_started_event:
|
164
|
+
command:
|
165
|
+
insert: *collection_name
|
166
|
+
documents:
|
167
|
+
- _id: 1
|
168
|
+
ordered: true
|
169
|
+
readConcern:
|
170
|
+
lsid: session0
|
171
|
+
txnNumber:
|
172
|
+
$numberLong: "1"
|
173
|
+
startTransaction: true
|
174
|
+
autocommit: false
|
175
|
+
writeConcern:
|
176
|
+
command_name: insert
|
177
|
+
database_name: *database_name
|
178
|
+
- command_started_event:
|
179
|
+
command:
|
180
|
+
abortTransaction: 1
|
181
|
+
lsid: session0
|
182
|
+
txnNumber:
|
183
|
+
$numberLong: "1"
|
184
|
+
startTransaction:
|
185
|
+
autocommit: false
|
186
|
+
writeConcern:
|
187
|
+
command_name: abortTransaction
|
188
|
+
database_name: admin
|
189
|
+
|
190
|
+
outcome:
|
191
|
+
collection:
|
192
|
+
data: []
|
193
|
+
|
194
|
+
- description: abort without start
|
195
|
+
|
196
|
+
operations:
|
197
|
+
- name: abortTransaction
|
198
|
+
object: session0
|
199
|
+
result:
|
200
|
+
errorContains: no transaction started
|
201
|
+
|
202
|
+
expectations: []
|
203
|
+
|
204
|
+
outcome:
|
205
|
+
collection:
|
206
|
+
data: []
|
207
|
+
|
208
|
+
- description: abort directly after no-op commit
|
209
|
+
|
210
|
+
operations:
|
211
|
+
- name: startTransaction
|
212
|
+
object: session0
|
213
|
+
- name: commitTransaction
|
214
|
+
object: session0
|
215
|
+
- name: abortTransaction # Error calling abort after no-op commit.
|
216
|
+
object: session0
|
217
|
+
result:
|
218
|
+
errorContains: Cannot call abortTransaction after calling commitTransaction
|
219
|
+
|
220
|
+
expectations: []
|
221
|
+
|
222
|
+
outcome:
|
223
|
+
collection:
|
224
|
+
data: []
|
225
|
+
|
226
|
+
- description: abort directly after commit
|
227
|
+
|
228
|
+
operations:
|
229
|
+
- name: startTransaction
|
230
|
+
object: session0
|
231
|
+
- name: insertOne
|
232
|
+
object: collection
|
233
|
+
arguments:
|
234
|
+
session: session0
|
235
|
+
document:
|
236
|
+
_id: 1
|
237
|
+
result:
|
238
|
+
insertedId: 1
|
239
|
+
- name: commitTransaction
|
240
|
+
object: session0
|
241
|
+
- name: abortTransaction # Error calling abort after commit.
|
242
|
+
object: session0
|
243
|
+
result:
|
244
|
+
errorContains: Cannot call abortTransaction after calling commitTransaction
|
245
|
+
|
246
|
+
expectations:
|
247
|
+
- command_started_event:
|
248
|
+
command:
|
249
|
+
insert: *collection_name
|
250
|
+
documents:
|
251
|
+
- _id: 1
|
252
|
+
ordered: true
|
253
|
+
readConcern:
|
254
|
+
lsid: session0
|
255
|
+
txnNumber:
|
256
|
+
$numberLong: "1"
|
257
|
+
startTransaction: true
|
258
|
+
autocommit: false
|
259
|
+
writeConcern:
|
260
|
+
command_name: insert
|
261
|
+
database_name: *database_name
|
262
|
+
- command_started_event:
|
263
|
+
command:
|
264
|
+
commitTransaction: 1
|
265
|
+
lsid: session0
|
266
|
+
txnNumber:
|
267
|
+
$numberLong: "1"
|
268
|
+
startTransaction:
|
269
|
+
autocommit: false
|
270
|
+
writeConcern:
|
271
|
+
command_name: commitTransaction
|
272
|
+
database_name: admin
|
273
|
+
|
274
|
+
outcome:
|
275
|
+
collection:
|
276
|
+
data:
|
277
|
+
- _id: 1
|
278
|
+
|
279
|
+
- description: abort ignores TransactionAborted
|
280
|
+
|
281
|
+
operations:
|
282
|
+
- name: startTransaction
|
283
|
+
object: session0
|
284
|
+
- name: insertOne
|
285
|
+
object: collection
|
286
|
+
arguments:
|
287
|
+
session: session0
|
288
|
+
document:
|
289
|
+
_id: 1
|
290
|
+
result:
|
291
|
+
insertedId: 1
|
292
|
+
# Abort the server transaction with a duplicate key error.
|
293
|
+
- name: insertOne
|
294
|
+
object: collection
|
295
|
+
arguments:
|
296
|
+
session: session0
|
297
|
+
document:
|
298
|
+
_id: 1
|
299
|
+
result:
|
300
|
+
errorCodeName: DuplicateKey
|
301
|
+
errorLabelsOmit: ["TransientTransactionError", "UnknownTransactionCommitResult"]
|
302
|
+
# Make sure the server aborted the transaction.
|
303
|
+
- name: insertOne
|
304
|
+
object: collection
|
305
|
+
arguments:
|
306
|
+
session: session0
|
307
|
+
document:
|
308
|
+
_id: 1
|
309
|
+
result:
|
310
|
+
errorCodeName: NoSuchTransaction
|
311
|
+
errorLabelsContain: ["TransientTransactionError"]
|
312
|
+
errorLabelsOmit: ["UnknownTransactionCommitResult"]
|
313
|
+
# abortTransaction must ignore the TransactionAborted and succeed.
|
314
|
+
- name: abortTransaction
|
315
|
+
object: session0
|
316
|
+
|
317
|
+
expectations:
|
318
|
+
- command_started_event:
|
319
|
+
command:
|
320
|
+
insert: *collection_name
|
321
|
+
documents:
|
322
|
+
- _id: 1
|
323
|
+
ordered: true
|
324
|
+
readConcern:
|
325
|
+
lsid: session0
|
326
|
+
txnNumber:
|
327
|
+
$numberLong: "1"
|
328
|
+
startTransaction: true
|
329
|
+
autocommit: false
|
330
|
+
writeConcern:
|
331
|
+
command_name: insert
|
332
|
+
database_name: *database_name
|
333
|
+
- command_started_event:
|
334
|
+
command:
|
335
|
+
insert: *collection_name
|
336
|
+
documents:
|
337
|
+
- _id: 1
|
338
|
+
ordered: true
|
339
|
+
readConcern:
|
340
|
+
lsid: session0
|
341
|
+
txnNumber:
|
342
|
+
$numberLong: "1"
|
343
|
+
startTransaction:
|
344
|
+
autocommit: false
|
345
|
+
writeConcern:
|
346
|
+
command_name: insert
|
347
|
+
database_name: *database_name
|
348
|
+
- command_started_event:
|
349
|
+
command:
|
350
|
+
insert: *collection_name
|
351
|
+
documents:
|
352
|
+
- _id: 1
|
353
|
+
ordered: true
|
354
|
+
readConcern:
|
355
|
+
lsid: session0
|
356
|
+
txnNumber:
|
357
|
+
$numberLong: "1"
|
358
|
+
startTransaction:
|
359
|
+
autocommit: false
|
360
|
+
writeConcern:
|
361
|
+
command_name: insert
|
362
|
+
database_name: *database_name
|
363
|
+
- command_started_event:
|
364
|
+
command:
|
365
|
+
abortTransaction: 1
|
366
|
+
lsid: session0
|
367
|
+
txnNumber:
|
368
|
+
$numberLong: "1"
|
369
|
+
startTransaction:
|
370
|
+
autocommit: false
|
371
|
+
writeConcern:
|
372
|
+
command_name: abortTransaction
|
373
|
+
database_name: admin
|
374
|
+
|
375
|
+
|
376
|
+
outcome:
|
377
|
+
collection:
|
378
|
+
data: []
|
379
|
+
|
380
|
+
- description: abort does not apply writeConcern
|
381
|
+
|
382
|
+
operations:
|
383
|
+
- name: startTransaction
|
384
|
+
object: session0
|
385
|
+
arguments:
|
386
|
+
options:
|
387
|
+
writeConcern:
|
388
|
+
w: 10
|
389
|
+
- name: insertOne
|
390
|
+
object: collection
|
391
|
+
arguments:
|
392
|
+
session: session0
|
393
|
+
document:
|
394
|
+
_id: 1
|
395
|
+
result:
|
396
|
+
insertedId: 1
|
397
|
+
- name: abortTransaction
|
398
|
+
object: session0
|
399
|
+
# No write concern error.
|
400
|
+
|
401
|
+
outcome:
|
402
|
+
collection:
|
403
|
+
data: []
|
@@ -0,0 +1,267 @@
|
|
1
|
+
database_name: &database_name "ruby-driver"
|
2
|
+
collection_name: &collection_name "transactions-tests"
|
3
|
+
|
4
|
+
data: []
|
5
|
+
|
6
|
+
tests:
|
7
|
+
- description: bulk
|
8
|
+
|
9
|
+
operations:
|
10
|
+
- name: startTransaction
|
11
|
+
object: session0
|
12
|
+
- name: insertOne
|
13
|
+
object: collection
|
14
|
+
arguments:
|
15
|
+
session: session0
|
16
|
+
document:
|
17
|
+
_id: 1
|
18
|
+
result:
|
19
|
+
insertedId: 1
|
20
|
+
- name: deleteOne
|
21
|
+
object: collection
|
22
|
+
arguments:
|
23
|
+
session: session0
|
24
|
+
filter:
|
25
|
+
_id: 1
|
26
|
+
result:
|
27
|
+
deletedCount: 1
|
28
|
+
- name: bulkWrite
|
29
|
+
object: collection
|
30
|
+
arguments:
|
31
|
+
session: session0
|
32
|
+
requests:
|
33
|
+
- name: insertOne
|
34
|
+
arguments:
|
35
|
+
document: {_id: 1}
|
36
|
+
- name: updateOne
|
37
|
+
arguments:
|
38
|
+
filter: {_id: 1}
|
39
|
+
update: {$set: {x: 1}}
|
40
|
+
- name: updateOne
|
41
|
+
arguments:
|
42
|
+
filter: {_id: 2}
|
43
|
+
update: {$set: {x: 2}}
|
44
|
+
upsert: true # Produces upsertedIds: {2: 2} in the result.
|
45
|
+
- name: insertOne
|
46
|
+
arguments:
|
47
|
+
document: {_id: 3}
|
48
|
+
- name: insertOne
|
49
|
+
arguments:
|
50
|
+
document: {_id: 4}
|
51
|
+
- name: insertOne
|
52
|
+
arguments:
|
53
|
+
document: {_id: 5}
|
54
|
+
- name: insertOne
|
55
|
+
arguments:
|
56
|
+
document: {_id: 6}
|
57
|
+
- name: insertOne
|
58
|
+
arguments:
|
59
|
+
document: {_id: 7}
|
60
|
+
# Keep replaces segregated from updates, so that drivers that aren't able to coalesce
|
61
|
+
# adjacent updates and replaces into a single update command will still pass this test
|
62
|
+
- name: replaceOne
|
63
|
+
arguments:
|
64
|
+
filter: {_id: 1}
|
65
|
+
replacement: {y: 1}
|
66
|
+
- name: replaceOne
|
67
|
+
arguments:
|
68
|
+
filter: {_id: 2}
|
69
|
+
replacement: {y: 2}
|
70
|
+
- name: deleteOne
|
71
|
+
arguments:
|
72
|
+
filter: {_id: 3}
|
73
|
+
- name: deleteOne
|
74
|
+
arguments:
|
75
|
+
filter: {_id: 4}
|
76
|
+
- name: updateMany
|
77
|
+
arguments:
|
78
|
+
filter: {_id: {$gte: 2}}
|
79
|
+
update: {$set: {z: 1}}
|
80
|
+
# Keep deleteMany segregated from deleteOne, so that drivers that aren't able to coalesce
|
81
|
+
# adjacent mixed deletes into a single delete command will still pass this test
|
82
|
+
- name: deleteMany
|
83
|
+
arguments:
|
84
|
+
filter: {_id: {$gte: 6}}
|
85
|
+
result:
|
86
|
+
deletedCount: 4
|
87
|
+
insertedIds: {0: 1, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7}
|
88
|
+
matchedCount: 7
|
89
|
+
modifiedCount: 7
|
90
|
+
upsertedCount: 1
|
91
|
+
upsertedIds: {2: 2}
|
92
|
+
- name: commitTransaction
|
93
|
+
object: session0
|
94
|
+
|
95
|
+
expectations:
|
96
|
+
- command_started_event:
|
97
|
+
command:
|
98
|
+
insert: *collection_name
|
99
|
+
documents:
|
100
|
+
- _id: 1
|
101
|
+
ordered: true
|
102
|
+
readConcern:
|
103
|
+
lsid: session0
|
104
|
+
txnNumber:
|
105
|
+
$numberLong: "1"
|
106
|
+
startTransaction: true
|
107
|
+
autocommit: false
|
108
|
+
writeConcern:
|
109
|
+
command_name: insert
|
110
|
+
database_name: *database_name
|
111
|
+
- command_started_event:
|
112
|
+
command:
|
113
|
+
delete: *collection_name
|
114
|
+
deletes:
|
115
|
+
- q: {_id: 1}
|
116
|
+
limit: 1
|
117
|
+
ordered: true
|
118
|
+
lsid: session0
|
119
|
+
txnNumber:
|
120
|
+
$numberLong: "1"
|
121
|
+
startTransaction:
|
122
|
+
autocommit: false
|
123
|
+
writeConcern:
|
124
|
+
command_name: delete
|
125
|
+
database_name: *database_name
|
126
|
+
# Commands in the bulkWrite.
|
127
|
+
- command_started_event:
|
128
|
+
command:
|
129
|
+
insert: *collection_name
|
130
|
+
documents:
|
131
|
+
- _id: 1
|
132
|
+
ordered: true
|
133
|
+
lsid: session0
|
134
|
+
txnNumber:
|
135
|
+
$numberLong: "1"
|
136
|
+
startTransaction:
|
137
|
+
autocommit: false
|
138
|
+
writeConcern:
|
139
|
+
command_name: insert
|
140
|
+
database_name: *database_name
|
141
|
+
- command_started_event:
|
142
|
+
command:
|
143
|
+
update: *collection_name
|
144
|
+
updates:
|
145
|
+
- q: {_id: 1}
|
146
|
+
u: {$set: {x: 1}}
|
147
|
+
multi: false
|
148
|
+
upsert: false
|
149
|
+
- q: {_id: 2}
|
150
|
+
u: {$set: {x: 2}}
|
151
|
+
multi: false
|
152
|
+
upsert: true
|
153
|
+
ordered: true
|
154
|
+
lsid: session0
|
155
|
+
txnNumber:
|
156
|
+
$numberLong: "1"
|
157
|
+
startTransaction:
|
158
|
+
autocommit: false
|
159
|
+
writeConcern:
|
160
|
+
command_name: update
|
161
|
+
database_name: *database_name
|
162
|
+
- command_started_event:
|
163
|
+
command:
|
164
|
+
insert: *collection_name
|
165
|
+
documents:
|
166
|
+
- _id: 3
|
167
|
+
- _id: 4
|
168
|
+
- _id: 5
|
169
|
+
- _id: 6
|
170
|
+
- _id: 7
|
171
|
+
ordered: true
|
172
|
+
lsid: session0
|
173
|
+
txnNumber:
|
174
|
+
$numberLong: "1"
|
175
|
+
startTransaction:
|
176
|
+
autocommit: false
|
177
|
+
writeConcern:
|
178
|
+
command_name: insert
|
179
|
+
database_name: *database_name
|
180
|
+
- command_started_event:
|
181
|
+
command:
|
182
|
+
update: *collection_name
|
183
|
+
updates:
|
184
|
+
- q: {_id: 1}
|
185
|
+
u: {y: 1}
|
186
|
+
multi: false
|
187
|
+
upsert: false
|
188
|
+
- q: {_id: 2}
|
189
|
+
u: {y: 2}
|
190
|
+
multi: false
|
191
|
+
upsert: false
|
192
|
+
ordered: true
|
193
|
+
lsid: session0
|
194
|
+
txnNumber:
|
195
|
+
$numberLong: "1"
|
196
|
+
startTransaction:
|
197
|
+
autocommit: false
|
198
|
+
writeConcern:
|
199
|
+
command_name: update
|
200
|
+
database_name: *database_name
|
201
|
+
- command_started_event:
|
202
|
+
command:
|
203
|
+
delete: *collection_name
|
204
|
+
deletes:
|
205
|
+
- q: {_id: 3}
|
206
|
+
limit: 1
|
207
|
+
- q: {_id: 4}
|
208
|
+
limit: 1
|
209
|
+
ordered: true
|
210
|
+
lsid: session0
|
211
|
+
txnNumber:
|
212
|
+
$numberLong: "1"
|
213
|
+
startTransaction:
|
214
|
+
autocommit: false
|
215
|
+
writeConcern:
|
216
|
+
command_name: delete
|
217
|
+
database_name: *database_name
|
218
|
+
- command_started_event:
|
219
|
+
command:
|
220
|
+
update: *collection_name
|
221
|
+
updates:
|
222
|
+
- q: {_id: {$gte: 2}}
|
223
|
+
u: {$set: {z: 1}}
|
224
|
+
multi: true
|
225
|
+
upsert: false
|
226
|
+
ordered: true
|
227
|
+
lsid: session0
|
228
|
+
txnNumber:
|
229
|
+
$numberLong: "1"
|
230
|
+
startTransaction:
|
231
|
+
autocommit: false
|
232
|
+
writeConcern:
|
233
|
+
command_name: update
|
234
|
+
database_name: *database_name
|
235
|
+
- command_started_event:
|
236
|
+
command:
|
237
|
+
delete: *collection_name
|
238
|
+
deletes:
|
239
|
+
- q: {_id: {$gte: 6}}
|
240
|
+
limit: 0
|
241
|
+
ordered: true
|
242
|
+
lsid: session0
|
243
|
+
txnNumber:
|
244
|
+
$numberLong: "1"
|
245
|
+
startTransaction:
|
246
|
+
autocommit: false
|
247
|
+
writeConcern:
|
248
|
+
command_name: delete
|
249
|
+
database_name: *database_name
|
250
|
+
- command_started_event:
|
251
|
+
command:
|
252
|
+
commitTransaction: 1
|
253
|
+
lsid: session0
|
254
|
+
txnNumber:
|
255
|
+
$numberLong: "1"
|
256
|
+
startTransaction:
|
257
|
+
autocommit: false
|
258
|
+
writeConcern:
|
259
|
+
command_name: commitTransaction
|
260
|
+
database_name: admin
|
261
|
+
|
262
|
+
outcome:
|
263
|
+
collection:
|
264
|
+
data:
|
265
|
+
- {_id: 1, y: 1}
|
266
|
+
- {_id: 2, y: 2, z: 1}
|
267
|
+
- {_id: 5, z: 1}
|