Liking cljdoc? Tell your friends :D

fooheads.setish


aggregateclj/s

(aggregate xrel m)
(aggregate xrel k f)

Applies f to the xrel and returns a relation with one tuple.

In the case a map is provided in place of k and f, the same procedure will be applied to all pairs of k and f in m.

Applies f to the xrel and returns a relation with one tuple.

In the case a map is provided in place of k and f, the same
procedure will be applied to all pairs of k and f in m.
sourceraw docstring

aggregate-byclj/s

(aggregate-by xrel agg-ks m-or-f)
(aggregate-by xrel agg-ks k f)

Groups by agg-ks and aggregates the grouped relations.

If a function is provided, it is expected to take a relation and return a relation

Groups by agg-ks and aggregates the grouped relations.

If a function is provided, it is expected to take a relation
and return a relation
sourceraw docstring

differenceclj/s

(difference s1)
(difference s1 s2)
(difference s1 s2 & sets)

Return a coll that is the first coll without elements of the remaining colls

Return a coll that is the first coll without elements of the remaining colls
sourceraw docstring

extendclj/s

(extend xrel m)
(extend xrel k f)

Extends each tuple by assoc:ing k to the result of (f tuple). k can either be a new key or an existing key.

A map from k to f can also be specified, to extend multiple attributes in one call.

Extends each tuple by assoc:ing k to the result of (f tuple).
k can either be a new key or an existing key.

A map from k to f can also be specified, to extend multiple
attributes in one call.
sourceraw docstring

indexclj/s

(index xrel ks)

Returns a map of the distinct values of ks in the xrel mapped to a set of the maps in xrel with the corresponding values of ks.

Returns a map of the distinct values of ks in the xrel mapped to a
set of the maps in xrel with the corresponding values of ks.
sourceraw docstring

index-uniqueclj/s

(index-unique xrel ks)

Like index but requires that each key only have one value. The vals in the index is a single value and not in a collection like with index. Throws if the unique constraint is not met.

Like `index` but requires that each key only have one value. The vals in the
index is a single value and not in a collection like with `index`. Throws
if the unique constraint is not met.
sourceraw docstring

intersectionclj/s

(intersection s1)
(intersection s1 s2)
(intersection s1 s2 & sets)

Return a coll that is the intersection of the input colls

Return a coll that is the intersection of the input colls
sourceraw docstring

joinclj/s

(join xrel yrel)
(join xrel yrel km)

When passed 2 rels, returns the rel corresponding to the natural join. When passed an additional keymap, joins on the corresponding keys.

When passed 2 rels, returns the rel corresponding to the natural
join. When passed an additional keymap, joins on the corresponding
keys.
sourceraw docstring

left-joinclj/s

(left-join xrel yrel km)

Joins, but always keeps enerything on the left, even if there is no match on the right. Each row will contain all keys from the left, plus all keys in the km (possibly with nil values), and, when there is a match, all keys from the right.

Joins, but always keeps enerything on the left, even if there is no
match on the right. Each row will contain all keys from the left, plus
all keys in the km (possibly with nil values), and, when there is a match,
all keys from the right.
sourceraw docstring

map-invertclj/s

Returns the map with the vals mapped to the keys.

Returns the map with the vals mapped to the keys.
sourceraw docstring

order-byclj/s

(order-by xrel keyfn)
(order-by xrel keyfn comp)

Orders the tuples according to keyfn and an optional comparator. Same behavior as clojure.core/sort-by, but with xrel in first position.

Orders the tuples according to keyfn and an optional comparator.
Same behavior as `clojure.core/sort-by`, but with xrel in first position.
sourceraw docstring

projectclj/s

(project xrel attr-names)

Returns a rel of the elements of xrel with only the keys in ks

Returns a rel of the elements of xrel with only the keys in ks
sourceraw docstring

project-awayclj/s

(project-away xrel attr-names)

Returns a rel of the elements of xrel without the keys in ks

Returns a rel of the elements of xrel without the keys in ks
sourceraw docstring

renameclj/s

(rename xrel kmap)

Returns a rel of the maps in xrel with the keys in kmap renamed to the vals in kmap

Returns a rel of the maps in xrel with the keys in kmap renamed to the vals in kmap
sourceraw docstring

rename-keysclj/s

Returns the map with the keys in kmap renamed to the vals in kmap

Returns the map with the keys in kmap renamed to the vals in kmap
sourceraw docstring

restrictclj/s

(restrict xrel pred?)

Returns a coll of the elements for which pred is true. Same as select but with the rel in first position to be more useful in a -> chain.

Returns a coll of the elements for which pred is true. Same as `select` but
with the rel in first position to be more useful in a -> chain.
sourceraw docstring

selectclj/s

(select pred? xrel)

Returns a coll of the elements for which pred is true

Returns a coll of the elements for which pred is true
sourceraw docstring

setishclj/s

(setish xs)

Return a coll of the same type as xs but without duplicates.

Return a coll of the same type as xs but without duplicates.
sourceraw docstring

subset?clj/s

(subset? coll1 coll2)

Is coll1 a subset of coll2

Is coll1 a subset of coll2
sourceraw docstring

sumclj/s

(sum k)

Convenience function to use with set aggregations.

Convenience function to use with set aggregations.
sourceraw docstring

superset?clj/s

(superset? coll1 coll2)

Is coll1 a superset of coll2?

Is coll1 a superset of coll2?
sourceraw docstring

unionclj/s

(union)
(union s1)
(union s1 s2)
(union s1 s2 & sets)

Return a coll that is the union of the input colls

Return a coll that is the union of the input colls
sourceraw docstring

updateclj/s

(update xrel k f & args)

Like clojure.core/update, but works on each tuple in a rel.

Like clojure.core/update, but works on each tuple in a rel.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close