Created
February 22, 2013 09:41
-
-
Save stanaka/5012125 to your computer and use it in GitHub Desktop.
a sample script to send LARGE requests to mongodb.
note: mongodb cannot deal with this request properly.
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 'moped' | |
session = Moped::Session.new([ "127.0.0.1:27017" ]) | |
session.use "test" | |
str = '' | |
1_000_000.times do | |
str << '0123456789' | |
end | |
records = [] | |
5.times do |i| | |
records << {'test' => str} | |
end | |
session.with(safe: true) do |safe| | |
safe[:artists].insert(records) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment