(append-and-replace struct m)
Append :Value
, :SdValue
and :N
if present. Relaces :Type
and
:Unit
.
Append `:Value`, `:SdValue` and `:N` if present. Relaces `:Type` and `:Unit`.
(fit-in-struct s m)
Fits m
into the given structure s
. Function looks up the
:Type
of m
. If a structure with the same :Type
exist
append-and-replace
is called.
Fits `m` into the given structure `s`. Function looks up the `:Type` of `m`. If a structure with the same `:Type` exist [[append-and-replace]] is called.
(store-result d x p)
Stores the result x
(ensured to be a map m
) in the given
d
ocument under p
ath. If m
contains :Type
and :Value
m
is fit-in-struct
and the structure s
is assumed to be a
vector
. Other cases (e.g. merge in :AuxValues
) are straight
forward (see [[vl-data-insert/test/cmp/doc_test.clj]] for details).
Stores the result `x`(ensured to be a map `m`) in the given `d`ocument under `p`ath. If `m` contains `:Type` and `:Value` `m` is [[fit-in-struct]] and the structure `s` is assumed to be a `vector`. Other cases (e.g. merge in `:AuxValues`) are straight forward (see [[vl-data-insert/test/cmp/doc_test.clj]] for details).
(store-results doc v p)
Takes a vector of maps. Calls store-result
on each map.
Example:
(def p "Calibration.Measurement.Values.Pressure")
(def m {:Type "a"
:Unit "b"
:Value [0]
:SdValue [0]
:N [1]})
(def d {:Calibration
{:Measurement
{:Values
{:Pressure
[{:Type "a"
:Unit "b"
:Value [0]
:SdValue [0]
:N [1]}]}}}})
(store-results d [m m m m] p)
;; =>
;; {:Calibration
;; {:Measurement
;; {:Values
;; {:Pressure
;; [{:Type "a",
;; :Unit "b",
;; :Value [0 0 0 0 0],
;; :SdValue [0 0 0 0 0],
;; :N [1 1 1 1 1]}]}}}}
Takes a vector of maps. Calls `store-result` on each map. Example: ```clojure (def p "Calibration.Measurement.Values.Pressure") (def m {:Type "a" :Unit "b" :Value [0] :SdValue [0] :N [1]}) (def d {:Calibration {:Measurement {:Values {:Pressure [{:Type "a" :Unit "b" :Value [0] :SdValue [0] :N [1]}]}}}}) (store-results d [m m m m] p) ;; => ;; {:Calibration ;; {:Measurement ;; {:Values ;; {:Pressure ;; [{:Type "a", ;; :Unit "b", ;; :Value [0 0 0 0 0], ;; :SdValue [0 0 0 0 0], ;; :N [1 1 1 1 1]}]}}}} ```
(vector-vals m)
Ensures that the values of :Value
,:SdValue
and :N
are
vectors.
Ensures that the values of `:Value`,`:SdValue` and `:N` are vectors.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close