Я делаю запрос, используя monger, вот так:
(let [uri mongo-uri
{:keys [conn db]} (mg/connect-via-uri mongo-uri-only)]
(defroutes myRoutes
(GET "/someroute" req
(let [user-id (:id (json/read-str (:body (get-user-info (:access_token (json/read-str (:body (get-authentication-response csrf-token req)) :key-fn keyword)))) :key-fn keyword)) ]
;; the query
(mc/find-one db "users" {:user-id user-id})
)))
mon go -uri:
"mongodb+srv://clojurewerkz/username:password@cluster0-ww5gh.mongodb.net/test?retryWrites=true&w=majority"
и mon go -uri- только:
"mongodb+srv://cluster0-ww5gh.mongodb.net/test?retryWrites=true&w=majority"
Но получите следующую ошибку при получении /someroute
HTTP ERROR 500 com.mongodb.MongoQueryException: Query failed with error code 8000 and error message 'user is not allowed to do action [find] on [test.users]' on server cluster0-shard-00-01-ww5gh.mongodb.net:27017
Что я делаю не так?