0

I'm making the a query using monger like so:

(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})

)))

the mongo-uri is :

"mongodb+srv://clojurewerkz/username:password@cluster0-ww5gh.mongodb.net/test?retryWrites=true&w=majority"

and mongo-uri-only is:

"mongodb+srv://cluster0-ww5gh.mongodb.net/test?retryWrites=true&w=majority"

But get the following error on getting /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

What am I doing wrong?

zengod
  • 1,114
  • 13
  • 26

0 Answers0