(batch-in db add-map)(batch-in db add-map remove-vec)(batch-in db path add-map remove-vec)batch add and removal of data
(-> (keystore) (put-in {:data {:a 1 :b 2} :input {:c 3 :d 4}}) (batch-in {:data {:x 1} :input {:y 2}} [[:data :a] [:input :d]]) (peek-in)) => {:data {:b 2, :x 1} :input {:c 3, :y 2}}
batch add and removal of data
(-> (keystore)
(put-in {:data {:a 1
:b 2}
:input {:c 3
:d 4}})
(batch-in {:data {:x 1}
:input {:y 2}}
[[:data :a] [:input :d]])
(peek-in))
=> {:data {:b 2, :x 1}
:input {:c 3, :y 2}}(create m)creates a keystore that is component compatible
(keystore/create {:type :mock :file {:path "dev/scratch/test.edn" :reset true}}) ;;=> #keystore.mock<uninitiased>
creates a keystore that is component compatible
(keystore/create {:type :mock
:file {:path "dev/scratch/test.edn"
:reset true}})
;;=> #keystore.mock<uninitiased>
(drop-in db)(drop-in db path)removes keys in the database
(-> (keystore) (put-in {:a 1, :b {:c 2}}) (drop-in [:a]) (peek-in)) => {:b {:c 2}}
removes keys in the database
(-> (keystore)
(put-in {:a 1, :b {:c 2}})
(drop-in [:a])
(peek-in))
=> {:b {:c 2}}(keys-in db)(keys-in db path)returns all keys in the particular level
(-> (keystore) (put-in {:a 1, :b {:c 2}}) (keys-in) (sort)) => [:a :b]
returns all keys in the particular level
(-> (keystore)
(put-in {:a 1, :b {:c 2}})
(keys-in)
(sort))
=> [:a :b](keystore)(keystore m)creates an active keystore
(keystore {:type :mock :initial {:hello :world} :file {:path "dev/scratch/test.edn" :reset true :cleanup true}}) ;;=> #keystore.mock{:hello :world}
creates an active keystore
(keystore {:type :mock
:initial {:hello :world}
:file {:path "dev/scratch/test.edn"
:reset true
:cleanup true}})
;;=> #keystore.mock{:hello :world}
(peek-in db)(peek-in db path)accesses all or part of the database
(-> (keystore) (put-in {:a 1, :b {:c 2}}) (peek-in [:b])) => {:c 2}
accesses all or part of the database
(-> (keystore)
(put-in {:a 1, :b {:c 2}})
(peek-in [:b]))
=> {:c 2}(put-in db v)(put-in db path v)adds data to the database
(-> (keystore) (put-in [:b] {:d 2}) (put-in [:b] {:c 2}) (peek-in)) => {:b {:d 2, :c 2}}
adds data to the database
(-> (keystore)
(put-in [:b] {:d 2})
(put-in [:b] {:c 2})
(peek-in))
=> {:b {:d 2, :c 2}}(select-in db v)(select-in db path v)selects the key values corresponding to the query (-> (keystore) (set-in [:data] {:a 1 :b 2 :c 3 :d 4}) (select-in [:data] odd?)) => [[:a 1] [:c 3]]
selects the key values corresponding to the query
(-> (keystore)
(set-in [:data] {:a 1
:b 2
:c 3
:d 4})
(select-in [:data] odd?))
=> [[:a 1] [:c 3]](set-in db v)(set-in db path v)adds data to the database. overwrites
(-> (keystore) (set-in [:b] {:d 2}) (set-in [:b] {:c 2}) (peek-in)) => {:b {:c 2}}
adds data to the database. overwrites
(-> (keystore)
(set-in [:b] {:d 2})
(set-in [:b] {:c 2})
(peek-in))
=> {:b {:c 2}}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 |