Skip to content
Paco Zamora Martinez edited this page Jun 13, 2014 · 4 revisions

Methods

mongo.ReplicaSet.New(auto_reconnect, rw_timeout) - Returns a new Connection object, or nil and an error.

db,err = mongo.ReplicaSet.New(name, {hostAndPort1, ...})
  • name: (string) - the name of the mongodb replica set to which you want to connect
  • hostAndPort: (table) - a table of strings containing the host and port of the servers in your replica set

connect() - Connect to a mongo replica set.

ok, err = db:connect() 

The remaining methods are identical to those found in MongoConnection.

Clone this wiki locally