For some reason, I cannot find the document when searching by the ID of the attached document. I can perform other finds quite easily, so these two work:
User.findOne({"_id" : some_id}, function(err,user){} User.findOne({"arrayOfNestedDocs.value":someValue}, function(err,user){}
But searching by id of the attached document does not work:
User.findOne({"arrayOfNestedDocs._id" : some_id}, function(err,user){}
I can do a search in the mongo shell, but not through mongoose. Any ideas would be helpful.
source share