Mongodb v0.4.2 Mongo.Topology

Summary

Functions

Starts a new topology connection, which handles pooling and server selection for replica sets

Types

initial_type()
initial_type ::
  :unknown |
  :single |
  :replica_set_no_primary |
  :sharded

Functions

connection_for_address(pid, address)
start_link(opts, gen_server_opts \\ [])
start_link(Keyword.t, Keyword.t) ::
  {:ok, pid} |
  {:error, reason :: atom}

Starts a new topology connection, which handles pooling and server selection for replica sets.

Options

  • :database - REQUIRED: database for authentication and default
  • :connect_timeout_ms - maximum timeout for connect
  • :seeds - a seed list of hosts (without the “mongodb://“ part) within the cluster, defaults to ["localhost:27017"]
  • :type - a hint of the topology type, defaults to :unknown, see initial_type/0 for valid values
  • :set_name - the expected replica set name, defaults to nil to 10 seconds

Error Reasons

  • :single_topology_multiple_hosts - a topology of type :single was set but multiple hosts were given
  • :set_name_bad_topology - a :set_name was given but the topology was set to something other than :replica_set_no_primary or :single
stop(pid)
topology(pid)