Skip to content

Instantly share code, notes, and snippets.

@peburrows
Created September 24, 2009 20:58
Show Gist options
  • Save peburrows/193047 to your computer and use it in GitHub Desktop.
Save peburrows/193047 to your computer and use it in GitHub Desktop.
>> db = Mongo::Connection.new.db('golden_child')
=> #<Mongo::DB:0x104f2bed0 @name="golden_child", @host="localhost", @pk_factory=nil, @socket=#<TCPSocket:0x104f2b4f8>, @slave_ok=nil, @port=27017, @nodes=[["localhost", 27017]], @auto_reconnect=nil, @semaphore=#<Object:0x104f2bd90 @mu_locked=false, @mu_waiting=[]>, @strict=nil>
>> coll = db['development.log']
=> #<Mongo::Collection:0x104f252d8 @name="development.log", @db=#<Mongo::DB:0x104f2bed0 @name="golden_child", @host="localhost", @pk_factory=nil, @socket=#<TCPSocket:0x104f2b4f8>, @slave_ok=nil, @port=27017, @nodes=[["localhost", 27017]], @auto_reconnect=nil, @semaphore=#<Object:0x104f2bd90 @mu_locked=false, @mu_waiting=[]>, @strict=nil>, @hint=nil>
>> coll.find(:action => 'show', :controller => 'cart').count
=> 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment