id=1 User.where(:id => params[:id]).first User.where(:id => 1).first
id[$gt]=0
User.where(:id => params[:id]).first User.where(:id => {"$gt" => 0}).first
You should be performing casts (usually to strings) before you pass your data to your ODM.
id[$gt]=0 User.where(:id => params[:id].to_s).first User.where(:id => "{:$gt=>0}").first
You should be performing casts (usually to strings) before you pass your data to your ODM.
This will correctly fail to a find a document.