For some reason I can't find a document when I search by the id of a nested document. I can perform other finds easily enough so these two work:
User.findOne({"_id" : some_id}, function(err,user){}
User.findOne({"arrayOfNestedDocs.value":someValue}, function(err,user){}
But finding by id of nested doc doesn't work:
User.findOne({"arrayOfNestedDocs._id" : some_id}, function(err,user){}
I can perform the search in a mongo shell so but not via mongoose. Any ideas would be helpful.
I've added it as an issue in the project
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With