There are two ways to automate interjection through call-back functions during calls:
Hooks allow you to make operations on documents (queries and payloads) during an API call. The main intention is to allow schema conversions to and from MongoDB.
(require '[com.timezynk.mongo.hooks :refer [with-hooks]])
(with-hooks {:write #(rename-keys % {:a :b})
:read #(rename-keys % {:b :a})}
(fetch-and-update-one! :coll
{:a 1}
{:$set {}}))
Guards allow you to add checks and operations before an API call is made. Inserts, updates, replacements each have their own guard.
Each guard has a default behaviour.
text
text
text
text
Can you improve this documentation? These fine people already did:
lars-timezynk & LarsEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close