Skip to content

Instantly share code, notes, and snippets.

@jptix
Created May 9, 2010 12:21
Show Gist options
  • Save jptix/395122 to your computer and use it in GitHub Desktop.
Save jptix/395122 to your computer and use it in GitHub Desktop.
{:count=>1365}
{:size=>1365}
{:size=>101}
/home/jptix/.rvm/gems/ruby-1.9.1-p378/gems/em-mongo-0.2.4/lib/em-mongo/connection.rb:184:in `block in receive_data': Buffer Overflow: Failed to parse buffer (RuntimeError)
from /home/jptix/.rvm/gems/ruby-1.9.1-p378/gems/em-mongo-0.2.4/lib/em-mongo/connection.rb:174:in `each'
from /home/jptix/.rvm/gems/ruby-1.9.1-p378/gems/em-mongo-0.2.4/lib/em-mongo/connection.rb:174:in `map'
from /home/jptix/.rvm/gems/ruby-1.9.1-p378/gems/em-mongo-0.2.4/lib/em-mongo/connection.rb:174:in `receive_data'
from /home/jptix/.rvm/gems/ruby-1.9.1-p378/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
from /home/jptix/.rvm/gems/ruby-1.9.1-p378/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
from mongoimport.rb:12:in `<main>'
require "rubygems"
require "em-mongo"
require "mongo"
coll = Mongo::Connection.new.db("ircbot").collection("seen")
p :count => coll.count
p :size => coll.find.to_a.size
EM.run do
collection = EM::Mongo::Connection.new.db("ircbot").collection("seen")
collection.find do |results|
p :size => results.size
end
collection.find({}, :limit => 2000) do |results|
p :size => results.size
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment