Changing 'is' test to 'are' for brevity.
This commit is contained in:
parent
9664961120
commit
94acfdec54
1 changed files with 13 additions and 15 deletions
|
|
@ -101,21 +101,19 @@
|
||||||
doc1 { :language "Clojure" :_id (ObjectId.) :inception_year 2006 }
|
doc1 { :language "Clojure" :_id (ObjectId.) :inception_year 2006 }
|
||||||
doc2 { :language "Java" :_id (ObjectId.) :inception_year 1992 }
|
doc2 { :language "Java" :_id (ObjectId.) :inception_year 1992 }
|
||||||
doc3 { :language "Scala" :_id (ObjectId.) :inception_year 2003 }
|
doc3 { :language "Scala" :_id (ObjectId.) :inception_year 2003 }
|
||||||
_ (mgcol/insert-batch coll [doc1 doc2])
|
_ (mgcol/insert-batch coll [doc1 doc2 doc3])]
|
||||||
lt-result (with-collection coll
|
(are [doc, result]
|
||||||
(find { :inception_year { "$lt" 2000 } }))
|
(= doc, result)
|
||||||
lte-result (with-collection coll
|
(doc2 (with-collection coll
|
||||||
(find { :inception_year { "$lte" 1992 } }))
|
(find { :inception_year { "$lt" 2000 } })))
|
||||||
gt-result (with-collection coll
|
(doc2 (with-collection coll
|
||||||
|
(find { :inception_year { "$lte" 1992 } })))
|
||||||
|
(doc1 (with-collection coll
|
||||||
(find { :inception_year { "$gt" 2002 } })
|
(find { :inception_year { "$gt" 2002 } })
|
||||||
(limit 1)
|
(limit 1)
|
||||||
(sort { :inception_year -1 }))
|
(sort { :inception_year -1 })))
|
||||||
gte-result (with-collection coll
|
(doc1 (with-collection coll
|
||||||
(find { :inception_year { "$gte" 2006 } }))]
|
(find { :inception_year { "$gte" 2006 } }))))))
|
||||||
(is (= [doc2] lt-result))
|
|
||||||
(is (= [doc2] lte-result))
|
|
||||||
(is (= [doc1] gt-result))
|
|
||||||
(is (= [doc1] gte-result))))
|
|
||||||
|
|
||||||
|
|
||||||
;; $all
|
;; $all
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue