Mongo.Connection
A connection process to a MongoDB server.
Summary
code_change(, s, ) | Callback implementation for |
start_link(opts) | Starts the connection process |
stop(conn) | Stops the connection process |
terminate(, ) | Callback implementation for |
Functions
Callback implementation for c:Connection.code_change/3
.
Specs:
- start_link(Keyword.t) :: GenServer.on_start
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
Specs:
- stop(pid) :: :ok
Stops the connection process.
Callback implementation for c:Connection.terminate/2
.