Skip to content

Instantly share code, notes, and snippets.

@sivakumarbdu
Created January 6, 2012 12:50
Show Gist options
  • Save sivakumarbdu/1570475 to your computer and use it in GitHub Desktop.
Save sivakumarbdu/1570475 to your computer and use it in GitHub Desktop.
Connect to Mongo DB from ruby
require 'mongo'
dbase = Mongo::Connection.new("localhost",27017).db("person")
person_collection = db.collection("interest")
person_collection.find().each do |row|
p row.inspect
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment