Provides data normalization functions.
Provides data normalization functions.
(like coll xs)
Returns a collection of the same type as coll containing all the elements of xs.
Returns a collection of the same type as coll containing all the elements of xs.
(many? x id-attrs)
Returns true if x is a cardinality many value.
Returns true if x is a cardinality many value.
(normalize x {:keys [id-attrs transform-fn] :as opts})
Given a possibly nested entity, returns tx seq of normalized entities. Optionally applies transformation fn to all entities before normalization.
Given a possibly nested entity, returns tx seq of normalized entities. Optionally applies transformation fn to all entities before normalization.
(ref? x id-attrs)
Returns true if x is an entity reference.
Returns true if x is an entity reference.
(refer-many xs {:keys [id-attrs] :as opts})
Same semantics as refer-one
, but for cardinality many args. Mixing
entities or entity references with non-entities is an error, and
checking this condition necessarily realizes entire input sequence.
Same semantics as `refer-one`, but for cardinality many args. Mixing entities or entity references with non-entities is an error, and checking this condition necessarily realizes entire input sequence.
(refer-one x {:keys [refer-fn id-attrs] :or {refer-fn find}})
Returns an entity reference to x, if x is a referable entity, nil otherwise.
Returns an entity reference to x, if x is a referable entity, nil otherwise.
(to-many x id-attrs)
Coerces x to a cardinality many value.
Coerces x to a cardinality many value.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close