开发者

Ruby - $or is not working in mongo local server, but working in online server

开发者 https://www.devze.com 2023-03-13 05:40 出处:网络
DdFbcrawlLinks.where(:$or => [{:feedtype => \"news\"},{:feedtype开发者_开发技巧 => \"wall\"}]).all
DdFbcrawlLinks.where(:$or => [{:feedtype => "news"},{:feedtype开发者_开发技巧 => "wall"}]).all

DdFbcrawlLinks is my model and it has the values. But unfortunately the abouve line is returning empty array

But the same code is working fine in online server

Please help


In your specific query, using $in would be better

DdFbcrawlLinks.where(:feedtype.in=>["news","wall"]).all

More: http://mongoid.org/docs/querying/criteria.html

0

精彩评论

暂无评论...
验证码 换一张
取 消