Close Cursor in queries
This commit is contained in:
parent
c3d2ed0c74
commit
80219176a4
1 changed files with 6 additions and 6 deletions
|
|
@ -64,7 +64,7 @@
|
||||||
|
|
||||||
(defn exec
|
(defn exec
|
||||||
[{ :keys [^DBCollection collection query fields skip limit sort batch-size hint snapshot read-preference keywordize-fields options] :or { limit 0 batch-size 256 skip 0 } }]
|
[{ :keys [^DBCollection collection query fields skip limit sort batch-size hint snapshot read-preference keywordize-fields options] :or { limit 0 batch-size 256 skip 0 } }]
|
||||||
(let [cursor (doto (.find collection (to-db-object query) (as-field-selector fields))
|
(with-open [cursor (doto (.find collection (to-db-object query) (as-field-selector fields))
|
||||||
(.limit limit)
|
(.limit limit)
|
||||||
(.skip skip)
|
(.skip skip)
|
||||||
(.sort (to-db-object sort))
|
(.sort (to-db-object sort))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue