(check-unique! conn id-ks & unique-datom-ks)
Check unique plain entity atoms, not checking nested. ex:
(check-unique! (connect!) :city/id :city/id #uuid"586c5e02-599e-4210-993a-f74bbdfc0e16" :city/name "Havana")
Check unique plain entity atoms, not checking nested. ex: - `(check-unique! (connect!) :city/id :city/id #uuid"586c5e02-599e-4210-993a-f74bbdfc0e16" :city/name "Havana")`
(check-unique-custom! conn id-ks custom-datom-ks & values)
Check unique plain entity atoms, with custom where datoms. ex:
Check unique plain entity atoms, with custom where datoms. ex: - `(check-unique-custom! conn :actor/id '[[?e :actor/name ?_0] [?e :actor/city ?c] [?c :city/name ?_1]] "Lenin" "Leningrad")
(delete! conn ks id)
deletes entity by matching id-ks and its value. ex:
(delete! conn :product-id 1917)
deletes entity by matching id-ks and its value. ex: - `(delete! conn :product-id 1917)`
(find-all conn id-ks)
(find-all conn id-ks pull-opts)
finds all entries having a key, pull-opts default is '[*]. ex:
(find-all conn :product-id) => [{:product-id 24},{:product-id 1917}]
(find-all conn :product-id '[* {:product/category [*]]) => [{:product-id 24, :product/category {:category/id 15}},{:product-id 1917, :product/category {:category/id 12}}]
finds all entries having a key, pull-opts default is '[*]. ex: - `(find-all conn :product-id) => [{:product-id 24},{:product-id 1917}]` - `(find-all conn :product-id '[* {:product/category [*]]) => [{:product-id 24, :product/category {:category/id 15}},{:product-id 1917, :product/category {:category/id 12}}]`
(find-by-id conn id-ks id)
(find-by-id conn id-ks id pull-opts)
finds single result by id, pull-opts default is '[*]. ex:
(find-by-id conn :product-id 1917) => {:product-id 1917}
(find-by-id conn :product-id 1917 '[* {:product/category [*]]}) => {:product-id 1917, :product/category {:category/id 12}}
finds single result by id, pull-opts default is '[*]. ex: - `(find-by-id conn :product-id 1917) => {:product-id 1917}` - `(find-by-id conn :product-id 1917 '[* {:product/category [*]]}) => {:product-id 1917, :product/category {:category/id 12}}`
(insert! conn to-be-saved)
(insert! conn to-be-saved check-unique)
inserts entity by using a simple datomic transact. Check unique possible as an optional param. ex:
(insert! conn {:product-id 8990})
(insert! conn {:product-id 8990} my-unique-check)
inserts entity by using a simple datomic transact. Check unique possible as an optional param. ex: - `(insert! conn {:product-id 8990})` - `(insert! conn {:product-id 8990} my-unique-check)`
(transform-out result-seq)
transforms d/q query results by removing db/id from root and nested maps. ex:
(transform-out {:db/id 12 :name "Rosa"}) => {:name "Rosa"}
transforms d/q query results by removing db/id from root and nested maps. ex: - `(transform-out {:db/id 12 :name "Rosa"}) => {:name "Rosa"}`
(update! conn id-ks id found-entity to-be-saved)
updates entity by matching id-key and its value, intersecting found-entity with to-be-saved, therefore using :db/cas strategy for matching datoms and :db/add for new ones. ex:
(update! conn :product-id 1917 {:age 0} {:age 1917})
updates entity by matching id-key and its value, intersecting found-entity with to-be-saved, therefore using :db/cas strategy for matching datoms and :db/add for new ones. ex: - `(update! conn :product-id 1917 {:age 0} {:age 1917})`
(upsert! conn [id-ks id] to-be-saved)
(upsert! conn [id-ks id] to-be-saved check-unique)
upserts entity, finding it by specified id or ks and executing either insert! or update!. Check unique possible as an optional param. ex:
(upsert! conn [:product-id 1917] {:done true})
(upsert! conn [:product-id 1917] {:done true} my-unique-check)
upserts entity, finding it by specified id or ks and executing either **insert!** or **update!**. Check unique possible as an optional param. ex: - `(upsert! conn [:product-id 1917] {:done true})` - `(upsert! conn [:product-id 1917] {:done true} my-unique-check)`
(upsert-foreign! conn foreign-ks foreign-id ref-ks main-ks main-id)
upserts foreign entity connected with an entity. ex:
(upsert-foreign! conn :group/id 17 :person/group :person/id 4)
upserts foreign entity connected with an entity. ex: - `(upsert-foreign! conn :group/id 17 :person/group :person/id 4)`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close