Merge branch 'typehint' of https://github.com/boechat107/monger into boechat107-typehint
This commit is contained in:
commit
c7a87ac776
1 changed files with 3 additions and 2 deletions
|
|
@ -167,10 +167,11 @@
|
|||
(merge m { :limit per-page :skip (monger.internal.pagination/offset-for page per-page) }))
|
||||
|
||||
(defmacro with-collection
|
||||
[^DB db ^String coll & body]
|
||||
[db coll & body]
|
||||
`(let [coll# ~coll
|
||||
^DB db# ~db
|
||||
db-coll# (if (string? coll#)
|
||||
(.getCollection ~db ^String coll#)
|
||||
(.getCollection db# coll#)
|
||||
coll#)
|
||||
query# (-> (empty-query db-coll#) ~@body)]
|
||||
(exec query#)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue