Skip to content

Instantly share code, notes, and snippets.

@banker
Created January 19, 2011 19:12
Show Gist options
  • Save banker/786661 to your computer and use it in GitHub Desktop.
Save banker/786661 to your computer and use it in GitHub Desktop.
ReplSetConnection.new(['db1.app.com'], ['db2.app.com'],
:rs_name => "myapp")
ReplSetConnection.new(['db1.app.com'], ['db2.app.com'],
:read_secondary => true)
@con = ReplSetConnection.new(['db1.app.com', 27017], ['db2.app.com', 27017])
@con = Connection.new("localhost", 27017, :safe => {:w = 3})
@db = @con['myapp']
@collection = @db['users']
@collection.insert({:username => "banker"})
@collection.insert({:username => "banker"}, :safe => {:w = 3})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment