开发者

Not equals in mongo mapper

I'm trying to run a query where I want to ignore records with a certain em开发者_Go百科ail address...

@foo = Bar.all(:email => 'xxx') <--- Except I want to negate where this email address exists.

Please let me know how I can do it.

Thanks!


Or

@foo = Bar.all(:email.ne => 'xxx')


Try:

@foo = Bar.all(:email => {"$ne" => "xxx"})


@foo = Bar.all(:email => {"$ne" => "xxx"})

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜