Move pagination helper to monger.internal.pagination
This commit is contained in:
parent
3534e579b7
commit
d9f5ae5951
3 changed files with 6 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
|||
(ns monger.pagination)
|
||||
(ns monger.internal.pagination)
|
||||
|
||||
(defn offset-for
|
||||
[^long page ^long per-page]
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
(ns monger.query
|
||||
(:refer-clojure :exclude [select find sort])
|
||||
(:require monger.core)
|
||||
(:require [monger.core]
|
||||
[monger.internal pagination])
|
||||
(:import [com.mongodb DB DBCollection DBObject DBCursor]
|
||||
[java.util List])
|
||||
(:use [monger conversion operators]))
|
||||
|
|
@ -82,7 +83,7 @@
|
|||
|
||||
(defn paginate
|
||||
[m & { :keys [page per-page] :or { page 1 per-page 10 } }]
|
||||
(merge m { :limit per-page :skip (monger.pagination/offset-for page per-page) }))
|
||||
(merge m { :limit per-page :skip (monger.internal.pagination/offset-for page per-page) }))
|
||||
|
||||
(defmacro with-collection
|
||||
[^String coll & body]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
(ns monger.test.pagination
|
||||
(ns monger.test.internal.pagination
|
||||
(:use [clojure.test]
|
||||
[monger.pagination]))
|
||||
[monger.internal.pagination]))
|
||||
|
||||
(deftest test-pagination-offset
|
||||
(are [a b] (= a b)
|
||||
Loading…
Reference in a new issue