michaelklishin / monger

Monger is an idiomatic Clojure MongoDB driver with sane defaults, batteries included, well documented, low overhead
http://clojuremongodb.info
484 stars 104 forks source link

Monger find-maps not returning any items in the collection #204

Open zendevil opened 3 years ago

zendevil commented 3 years ago

I'm using the monger database, which is showing the results from the find function. It's showing the results as empty even though I have items in my database. Here's the code:

(ns humboiserver.db.core
  (:require
   [monger.core :as mg]
   [monger.gridfs :as gfs]
   [monger.query :as q]
   [monger.collection :as mc]
   [cheshire.core :as json]
   )
  (:import
   org.bson.types.ObjectId))

(let [{:keys [conn db]}
      (mg/connect-via-uri "mongodb+srv://user:pass@cluster0.ww5gh.mongodb.net/<dbname>?retryWrites=true&w=majority")]
  (defn find [coll query] (mc/find-maps db coll query))

Here's the usage:

 (db/find "featured" {})

And here's the featured database:

enter image description here

Yet doing the find is returning an empty sequence. How to fix this?