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"})
精彩评论