Created
November 16, 2021 23:34
-
-
Save duanebester/5e3928067b42b285b6ffd93e1207de57 to your computer and use it in GitHub Desktop.
Web Scraping w/ Clojure add products to Mongo
This file contains hidden or 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
;; Mongo | |
(require '[somnium.congomongo :as m]) | |
;; Products database | |
(def mongo-conn | |
(m/make-connection | |
"products" | |
:instances [{:host "127.0.0.1" :port 27017}])) | |
;; Set global connection | |
(m/set-connection! mongo-conn) | |
;; Add product offers to "bellroy" collection | |
(m/mass-insert! "bellroy" (:offers product-json)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment