开发者

MongoMapper OR clause on 2 columns - Rails 3.1.rc4

How to perform something like this:

User.where("private = 1 开发者_开发知识库OR beta = 0")


See: http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24or

That translates to:

User.where(:$or => [{:private => 1}, {:beta => 0}])
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜