开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜