Mongoid nie jest w zapytaniu
Mam problemy z mangustem:
<code> test "Test candidate" do User.create(:id => 1, :sex => User::Male, :country => 1, :city => 1) User.create(:id => 2, :sex => User::Female, :country => 1, :city => 1) User.create(:id => 3, :sex => User::Female, :country => 1, :city => 1) user = User.not_in(:id => [2]).second assert_not_equal(user.id, 2) end </code>
Test nieudany. Próbowałem użyć where (: id => {'$ nid' => [2]}), ale ma ten sam efekt.
Co jest nie tak? Jak używać warunku „nie w” z mongoidem?
PS, „second” jest ok, z „pierwszym” testem, ponieważ id = 1