Mongo.Connection

A connection process to a MongoDB server.

Source

Summary

code_change(, s, )

Callback implementation for c:Connection.code_change/3

start_link(opts)

Starts the connection process

stop(conn)

Stops the connection process

terminate(, )

Callback implementation for c:Connection.terminate/2

Functions

code_change(, s, )

Callback implementation for c:Connection.code_change/3.

Source
start_link(opts)

Specs:

Starts the connection process.

Options

  • :hostname - Server hostname (Default: “localhost”)
  • :port - Server port (Default: 27017)
  • :database - Database (required);
  • :username - Username
  • :password - User password
  • :backoff - Backoff time for reconnects, the first reconnect is instantaneous (Default: 1000)
  • :timeout - TCP connect and receive timeouts (Default: 5000)
  • :w - The number of servers to replicate to before returning from write operators, a 0 value will return immediately, :majority will wait until the operation propagates to a majority of members in the replica set (Default: 1)
  • :j If true, the write operation will only return after it has been committed to journal - (Default: false)
  • :wtimeout - If the write concern is not satisfied in the specified interval, the operation returns an error
Source
stop(conn)

Specs:

  • stop(pid) :: :ok

Stops the connection process.

Source
terminate(, )

Callback implementation for c:Connection.terminate/2.

Source