I am trying to query a user in my mongodb collection based on the following mongodb request:
db.users.find("boxes":{"$elemMatch":{"a":"foo","b":"bar"}})
This works if I request directly with mongodb. It returns any user who has a field with = "foo" and b = "bar".
How can I request this in mongoosejs? I tried using User.find().elemMatch , but it does not work. It looks like it is just projecting the results anyway. The original mongodb request really works for me, but I just need to replicate it in mongoosejs. Any ideas?
brandon
source share