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

Array Query returning empty result #205

Closed genovese closed 3 years ago

genovese commented 3 years ago

I have a field that is an array of ObjectId's. To match objects whose field contains a given id, the mongo query works fine:

db.users.findOne({"arrayofIds": ObjectId("5b11af1ca7d3721b1417df6a")})
  #=> returns the expected doc

The corresponding Monger query (and several variations) does not find anything:

(mc/find-one-as-map db "users" {:arrayofIds (ObjectId. "5b11af1ca7d3721b1417df6a")})
  #=> nil

This is running under MongoDB 2.6.

Is this monger query incorrect? Is this a mismatch between Monger and the later versions of Mongo? Something else?

Thanks for your help!

P.S. Is Monger still being maintained?

genovese commented 3 years ago

Sorry; this seems to have been something wrong on my end. I restarted everything and now it's working. Apologies for the extraneous issue. Thanks.