Skip to content

Instantly share code, notes, and snippets.

@banker
Created February 8, 2011 17:54
Show Gist options
  • Save banker/816850 to your computer and use it in GitHub Desktop.
Save banker/816850 to your computer and use it in GitHub Desktop.
require 'mongo'
c = Mongo::Connection.new
c['test']['nums'].remove
c['test']['nums'].save({:n => 2147483635})
1000.times do
c['test']['nums'].update({}, {"$inc" => {:n => 1}})
p c['test']['nums'].find_one
if c['test']['nums'].find_one({:n => {"$type" => 16}})
p "Int"
elsif c['test']['nums'].find_one({:n => {"$type" => 18}})
p "long"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment