Class: Mongo::Connection Deprecated

Inherits:
MongoClient show all
Includes:
LegacyWriteConcern
Defined in:
lib/mongo/legacy.rb

Overview

Deprecated.

Use Mongo::MongoClient instead. Support will be removed after v2.0. Please see old documentation for the Connection class.

Constant Summary

Constant Summary

Constants inherited from MongoClient

MongoClient::AGG_RETURNS_CURSORS, MongoClient::APPEND_HEADROOM, MongoClient::BATCH_COMMANDS, MongoClient::CLIENT_ONLY_OPTS, MongoClient::COMMAND_HEADROOM, MongoClient::ConditionVariable, MongoClient::DEFAULT_DB_NAME, MongoClient::DEFAULT_HOST, MongoClient::DEFAULT_MAX_WRITE_BATCH_SIZE, MongoClient::DEFAULT_PORT, MongoClient::GENERIC_OPTS, MongoClient::MAX_WIRE_VERSION, MongoClient::MIN_WIRE_VERSION, MongoClient::Mutex, MongoClient::POOL_OPTS, MongoClient::READ_PREFERENCE_OPTS, MongoClient::RELEASE_2_4_AND_BEFORE, MongoClient::SERIALIZE_HEADROOM, MongoClient::SSL_OPTS, MongoClient::TIMEOUT_OPTS, MongoClient::WRITE_CONCERN_OPTS

Constants included from Authentication

Authentication::DEFAULT_MECHANISM, Authentication::EXTRA, Authentication::MECHANISMS

Constants included from Networking

Networking::RESPONSE_HEADER_SIZE, Networking::STANDARD_HEADER_SIZE

Instance Attribute Summary

Attributes inherited from MongoClient

#acceptable_latency, #auths, #connect_timeout, #host_to_try, #logger, #max_wire_version, #max_write_batch_size, #min_wire_version, #op_timeout, #pool_size, #pool_timeout, #primary, #primary_pool, #read, #size, #socket_class, #socket_opts, #tag_sets, #write_concern

Attributes included from WriteConcern

#legacy_write_concern

Instance Method Summary (collapse)

Methods included from LegacyWriteConcern

from_uri, #safe, #safe=

Methods inherited from MongoClient

#[], #active?, #apply_saved_authentication, #authenticate_pools, #check_is_master, #checkin, #checkout_reader, #checkout_writer, #close, #connect, #connected?, #copy_database, #database_info, #database_names, #db, #drop_database, from_uri, #host, #host_port, #lock!, #locked?, #logout_pools, #max_bson_size, #max_message_size, #mongos?, multi, #pin_pool, #ping, #pinned_pool, #port, #primary_wire_version_feature?, #read_pool, #read_primary?, #refresh, #server_info, #server_version, #slave_ok?, #unlock!, #unpin_pool, #use_write_command?, #wire_version_feature?

Methods included from Authentication

#add_auth, auth_key, #clear_auths, hash_password, #issue_authentication, #issue_logout, #remove_auth, validate_credentials, validate_mechanism

Methods included from WriteConcern

#get_write_concern, gle?, #write_concern_from_legacy

Methods included from Networking

#add_message_headers, #build_command_message, #build_get_last_error_message, #check_response_flags, #get_request_id, #read_documents, #receive_data, #receive_header, #receive_message, #receive_message_on_socket, #receive_response_header, #send_message, #send_message_on_socket, #send_message_with_gle

Methods included from Logging

#instrument, instrumenter, instrumenter=, #log, #write_logging_startup_message

Constructor Details

- (Connection) initialize(*args)

A new instance of Connection



46
47
48
49
50
51
52
53
# File 'lib/mongo/legacy.rb', line 46

def initialize(*args)
  if args.last.is_a?(Hash)
    opts = args.pop
    write_concern_from_legacy(opts)
    args.push(opts)
  end
  super
end