I have a schema
{
...
windows: [{name:String}]
...
}
If I run Model.find({windows._id:'string'}) everything is ok, mongoose is sending query {"windows._id":ObjectId('string')} and returns records;
If I extend the schema somehow (ex. just {S_V:Number}),
find() do not return anything, because mongoose is sending query {'windows._id':'string'}, which searches for string-type _ids and fails to find any.
I have a schema { ... windows: [{name:String}] ... } If I run Model.find({windows._id:'string'}) everything is ok, mongoose is sending query {"windows._id":ObjectId('string')} and returns records;
If I extend the schema somehow (ex. just {S_V:Number}), find() do not return anything, because mongoose is sending query {'windows._id':'string'}, which searches for string-type _ids and fails to find any.
This issue contains more information and real code example: https://github.com/Automattic/mongoose/issues/3364#issuecomment-141353516