开发者

Not equals in mongo mapper

开发者 https://www.devze.com 2023-01-12 09:19 出处:网络
I\'m trying to run a query where I want to ignore records with a certain em开发者_Go百科ail address...

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

精彩评论

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