cmp.doc

add

(add mpd-id id)

Adds a info map to the short term memory.

base-info

(base-info doc)

Returns a map with documents base info.

doc->id

(doc->id {id :_id})

doc->version

(doc->version {rev :_rev})

Returns the version of the document as an integer value:

doc-info

multimethod

Extracts informations about a document depending on the type.

doc-lock

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)

renew!

(renew! mpd-id v)

Renew the id interface with the give ids-vector v.

rm

(rm mpd-id id)

Removes the info map from the short term memory.

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)