Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试运行一个查询,我想忽略具有某个电子邮件地址的记录...
@foo = Bar.all(:email => 'xxx') <--- 除了我想否定这个电子邮件地址的存在位置。
请让我知道我该怎么做。
谢谢!
或者
@foo = Bar.all(:email.ne => 'xxx')
尝试:
@foo = Bar.all(:email => {"$ne" => "xxx"})