Created
May 9, 2010 12:21
-
-
Save jptix/395122 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{: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>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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