(process-fill-empty sfill tdata nsv interim tsch datasource)helper functio for wrap-model-fill-empty
(process-fill-empty {:age 10} {:name "Chris"} [:account] {} (-> (schema/schema examples/account-name-age-sex) :tree :person) {}) => {:name "Chris", :age 10}
helper functio for wrap-model-fill-empty
(process-fill-empty {:age 10}
{:name "Chris"}
[:account]
{}
(-> (schema/schema examples/account-name-age-sex)
:tree
:person)
{})
=> {:name "Chris", :age 10}(wrap-model-fill-empty f)fill empty entry with either value or function
(pipeline/normalise {:account/name "Chris"} {:schema (schema/schema examples/account-name-age-sex) :pipeline {:fill-empty {:account {:age 10}}}} {:normalise [wrap-model-fill-empty]}) => {:account {:name "Chris", :age 10}}
(pipeline/normalise {:account/name "Chris"} {:schema (schema/schema examples/account-name-age-sex) :pipeline {:fill-empty {:account {:age (fn [_ datasource] (:age datasource))}}} :age 10} {:normalise [wrap-model-fill-empty]}) => {:account {:name "Chris", :age 10}}
(pipeline/normalise {:account/name "Chris" :account/age 9} {:schema (schema/schema examples/account-name-age-sex) :pipeline {:fill-empty {:account {:age 10}}}} {:normalise [wrap-model-fill-empty]}) => {:account {:name "Chris" :age 9}}
fill empty entry with either value or function
(pipeline/normalise {:account/name "Chris"}
{:schema (schema/schema examples/account-name-age-sex)
:pipeline {:fill-empty {:account {:age 10}}}}
{:normalise [wrap-model-fill-empty]})
=> {:account {:name "Chris", :age 10}}
(pipeline/normalise {:account/name "Chris"}
{:schema (schema/schema examples/account-name-age-sex)
:pipeline {:fill-empty {:account {:age (fn [_ datasource]
(:age datasource))}}}
:age 10}
{:normalise [wrap-model-fill-empty]})
=> {:account {:name "Chris", :age 10}}
(pipeline/normalise {:account/name "Chris" :account/age 9}
{:schema (schema/schema examples/account-name-age-sex)
:pipeline {:fill-empty {:account {:age 10}}}}
{:normalise [wrap-model-fill-empty]})
=> {:account {:name "Chris" :age 9}}cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |