File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. This change
5
5
## [ Unreleased]
6
6
### Changed
7
7
- Renamed indexes-of to offsets-of.
8
+
8
9
### Added
9
10
- Added range.
10
11
Original file line number Diff line number Diff line change 7
7
:src-dir-uri " https://github.com/apa512/clj-rethinkdb/blob/master/"
8
8
:src-linenum-anchor-prefix " L" }
9
9
:global-vars {*warn-on-reflection* true }
10
- :plugins [[codox " 0.9.4 " ]]
10
+ :plugins [[lein- codox " 0.9.5 " ]]
11
11
:dependencies [[org.clojure/clojure " 1.7.0" ]
12
12
[org.clojure/clojurescript " 1.7.48" :scope " provided" ]
13
13
[org.clojure/core.async " 0.2.374" ]
Original file line number Diff line number Diff line change 207
207
(deftest aggregation
208
208
(with-open [conn (r/connect )]
209
209
(are [term result] (= (r/run term conn) result)
210
+ (r/group [1 6 1 8 ] (r/fn [e] e)) {1 [1 1 ], 6 [6 ], 8 [8 ]}
211
+ (r/ungroup (r/group [1 6 1 8 ] (r/fn [e] e))) [{:group 1 , :reduction [1 1 ]}
212
+ {:group 6 , :reduction [6 ]}
213
+ {:group 8 , :reduction [8 ]}]
214
+ (r/count [1 6 1 8 ]) 4
215
+ (r/count " asdf" ) 4
216
+ (r/count {:a 1 :b 2 :c 3 }) 3
217
+ (r/sum [3 4 ]) 7
210
218
(r/avg [2 4 ]) 3
211
219
(r/min [4 2 ]) 2
212
220
(r/max [4 6 ]) 6
213
- (r/sum [ 3 4 ]) 7
221
+ (r/distinct [ 1 6 1 8 ]) [ 1 6 8 ]
214
222
(r/contains [1 6 1 8 ] 1 ) true
215
223
(r/contains [1 6 1 8 ] 2 ) false )))
216
224
375
383
(are [term result] (= result (r/run term conn))
376
384
(r/branch true 1 0 ) 1
377
385
(r/branch false 1 0 ) 0
386
+ (r/limit (r/range ) 4 ) [0 1 2 3 ]
378
387
(r/range 5 ) [0 1 2 3 4 ]
379
388
(r/range 3 5 ) [3 4 ]
380
389
(r/coerce-to [[" name" " Pikachu" ]] " OBJECT" ) {:name " Pikachu" }
You can’t perform that action at this time.
0 commit comments