问题
I'm trying to run a query where I want to ignore records with a certain email 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!
回答1:
Or
@foo = Bar.all(:email.ne => 'xxx')
回答2:
Try:
@foo = Bar.all(:email => {"$ne" => "xxx"})
回答3:
@foo = Bar.all(:email => {"$ne" => "xxx"})
来源:https://stackoverflow.com/questions/3541528/not-equals-in-mongo-mapper