Skip to content

Instantly share code, notes, and snippets.

@chelm
Created July 18, 2011 22:09
Show Gist options
  • Select an option

  • Save chelm/1090809 to your computer and use it in GitHub Desktop.

Select an option

Save chelm/1090809 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'mongo'
limit = ARGV[0].to_i || 1000
db = Mongo::Connection.new('db.more-eyes.t-sciences.com').db('MoreEyesDev')
db.authenticate('moreeyes', 'Fun$tu55')
coll = db.collection('ACSP')
start = Time.now
puts "Sending... #{Time.now}"
c = coll.find().limit(limit)
puts "Returned... #{Time.now}"
i = 0
puts "Looping... #{Time.now}"
c.each do |doc|
puts i
i += 1
end
endtime = Time.now
puts "Finished. #{Time.now}"
puts "total time #{endtime - start}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment