This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn datomic-key->regular-key [datomic-key] | |
(-> datomic-key | |
name | |
any-other-transform | |
keyword)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:user/first-name "amit" | |
:user/last-name "rathore" | |
:db/id 123123123} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn convert-to-regular-map [user-entity] | |
(-> user-entity | |
(select-keys some-interesting-keys) | |
(maps/update-all-map-keys datomic-key->regular-key))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:first-name "amit" | |
:last-name "rathore" | |
:db/id 123123123} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn doeach [function coll] | |
(doseq [c coll] | |
(function c))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn domap [function coll] | |
(->> coll (map function) doall)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn handle-batch [batch] | |
(blah blah...)) | |
(->> coll | |
(partition-all n) | |
(pmapcat handle-batch)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:a 1, | |
:c {:a 1, :c {:a 1, :b 2}, :b 2}, | |
:b [2 3], | |
:d [{:a 1, :c 3, :b 2} {:a [1 2 3], :b {:a 1, :b 2}}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user> (println m "blah blah" m) | |
{:a 1, :c {:a 1, :c {:a 1, :b 2}, :b 2}, :b [2 3], :d [{:a 1, :c 3, :b 2} {:a [1 2 3], :b {:a 1, :b 2}}]} blah blah {:a 1, :c {:a 1, :c {:a 1, :b 2}, :b 2}, :b [2 3], :d [{:a 1, :c 3, :b 2} {:a [1 2 3], :b {:a 1, :b 2}}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user> (println (pp-str m "blah blah" m)) | |
{:a 1, | |
:c {:a 1, :c {:a 1, :b 2}, :b 2}, | |
:b [2 3], | |
:d [{:a 1, :c 3, :b 2} {:a [1 2 3], :b {:a 1, :b 2}}]} | |
"blah blah" | |
{:a 1, | |
:c {:a 1, :c {:a 1, :b 2}, :b 2}, | |
:b [2 3], | |
:d [{:a 1, :c 3, :b 2} {:a [1 2 3], :b {:a 1, :b 2}}]} |