From d081a201dad9b888ef593631263103a734416683 Mon Sep 17 00:00:00 2001 From: Oleksandr Petrov Date: Wed, 25 Jan 2012 22:19:51 +0100 Subject: [PATCH] Adding non-array tests for $nin and $in operators. --- test/monger/test/query_operators.clj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/monger/test/query_operators.clj b/test/monger/test/query_operators.clj index f2e092f..67c6b32 100644 --- a/test/monger/test/query_operators.clj +++ b/test/monger/test/query_operators.clj @@ -79,7 +79,9 @@ (is (= "Scala" (:language (first (mgcol/find-maps collection { :tags { $all [ "functional" "object-oriented" ] } } ))))) (is (= 3 (.count (mgcol/find-maps collection { :tags { $in [ "functional" "object-oriented" ] } } )))) - (is (= 1 (.count (mgcol/find-maps collection { :tags { $nin [ "functional" ] } } )))))) + (is (= 2 (.count (mgcol/find-maps collection { :language { $in [ "Scala" "Ruby" ] } } )))) + (is (= 1 (.count (mgcol/find-maps collection { :tags { $nin [ "dynamic", "object-oriented" ] } } )))) + (is (= 3 (.count (mgcol/find-maps collection { :language { $nin [ "C#" ] } } )))))) (deftest find-with-conditional-operators-on-embedded-documents