views:

59

answers:

2

Hi there

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  A: 

Try:

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

Or

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

Allan