cmp.doc
doc->version
(doc->version {rev :_rev})Returns the version of the document as an integer value:
doc-type
(doc-type doc m)Returns the type of the document. Assumes the type of the document to be the first key hierarchy beside :_id and :_rev.
ids
(ids mp-id)Returns the list of ids added.
Example:
(add "devs" "cal-2018-ce3-kk-75003_0002")
;; hiob DEBUG [cmp.lt-mem:14] - try to get
;; document with id: cal-2018-ce3-kk-75003_0002
;; OK
(ids "devs")
;; (cal-2018-ce3-kk-75003_0002)
store!
(store! mp-id results doc-path)Stores the results vector under the doc-path of every document loaded at the given mp-id. Checks if the version of each document is +1. Returns {:ok true} or {:error <problem>}.
Example:
(def results [{:Type "cmp-test" :Unit "Pa" :Value 1}
{:Type "cmp-test2" :Unit "Pa" :Value 2}])
(def doc-path "Calibration.Measurement.Values.Pressure")
(store! "ref" results doc-path)