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

Constants inherited from MongoClient

MongoClient::CLIENT_ONLY_OPTS, MongoClient::ConditionVariable, MongoClient::DEFAULT_DB_NAME, MongoClient::DEFAULT_HOST, MongoClient::DEFAULT_PORT, MongoClient::GENERIC_OPTS, MongoClient::Mutex, MongoClient::POOL_OPTS, MongoClient::READ_PREFERENCE_OPTS, MongoClient::TIMEOUT_OPTS, MongoClient::WRITE_CONCERN_OPTS

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, #op_timeout, #pool_size, #pool_timeout, #primary, #primary_pool, #read, #size, #socket_class, #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?, #add_auth, #apply_saved_authentication, #authenticate_pools, #checkin, #checkout_reader, #checkout_writer, #clear_auths, #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, #parse_init, #pin_pool, #ping, #pinned_pool, #port, #read_pool, #read_primary?, #refresh, #remove_auth, #server_info, #server_version, #slave_ok?, #unlock!, #unpin_pool

Methods included from WriteConcern

#get_write_concern, gle?, #write_concern_from_legacy

Methods included from Networking

#receive_message, #send_message, #send_message_with_gle

Methods included from Logging

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

Constructor Details

#initialize(*args) ⇒ Connection

Returns a new instance of Connection.



32
33
34
35
36
37
38
39
# File 'lib/mongo/legacy.rb', line 32

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