I am using monger to connect with the database, but I'm getting that the connection string is invalid:
Caused by: java.lang.IllegalArgumentException: The connection string is invalid. Connection strings must start with 'mongodb://'
Here's my code in which I'm putting the connection string:
(let [{:keys [conn db]} (mg/connect-via-uri "mongodb+srv://username:pass@cluster0-ww5gh.mongodb.net/test?retryWrites=true&w=majority")
fs (mg/get-gridfs conn "test")]
(defn store-file [{:keys [file filename format content-type]}]
(gfs/store-file (gfs/make-input-file fs file)
(gfs/filename filename)
(gfs/metadata {:format format})
(gfs/content-type content-type)))
(defn gfs-find-by-id [id]
(gfs/find-by-id fs id))
(defn find-file [id] (gfs/find-by-id fs id))
(defn find-one [coll query] (mc/find-one-as-map db coll query))
(defn find-by-id [coll id] (mc/find-map-by-id db coll id))
(defn find [coll query] (mc/find-maps db coll query))
(defn insert [coll query] (mc/insert-and-return db coll query))
(defn update [coll entry query] (mc/update db coll entry query {:upsert true}))
(defn update-multi [coll entry query] (mc/update db coll entry query {:upsert true :multi true}))
(defn update-by-id [coll id query] (mc/update-by-id db coll id query {:upsert true}))
(defn find-page-n [coll query page n]
(prn "finding" n "items on page " page)
(q/with-collection
db
coll
(q/find query)
(q/paginate :page page :per-page n))))
How to fix this error?