January 2018
Intermediate to advanced
336 pages
7h 56m
English
All the facts present in a Datomic database are immutable and are valid for any given timestamp. For example, the status of an order with :db/id 2 in the current state of the database is set as Pending. Take a look at the following example:
(d/q '[:find ?e ?s :where [?e :order/status ?s]] (d/db conn))#{[1 "Done"] [2 "Pending"]}
Now, try to update the value of the :order/status attribute for order ID 2 to Done by transacting with its :db/id. Take a look at the following example:
;; update the status attribute to 'Done' for order ID '2'(def status-result (d/transact conn [{:db/id 2 :order/status "Done"}]))#'pedestal-play.server/status-result;; query the latest state of database(d/q '[:find ?e ?s :where [?e :order/status ...Read now
Unlock full access