require 'rubygems'
require 'mongo'
require 'pry'
require 'win32ole'
db = Mongo::Connection.new.db("test")
x = db['text']
y = x.find({a: {$gt: 0}})
y.each {|y| puts y }
{"_id"=>BSON::ObjectId('51630eea5a8d7b8a8be738c0'), "a"=>1.0} {"_id"=>BSON::ObjectId('51632de8583be71698000001'), "a"=>1} {"_id"=>BSON::ObjectId('51632de8583be71698000002'), "a"=>1, "b"=>2}
The Error
syntax error, unexpected ':', expecting tASSOC
# for this line at the $gt: part
y = x.find({a: {$gt: 0}})