Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-casting for subdocument._id not work #31

Open
Crotery opened this issue Sep 18, 2015 · 1 comment
Open

Auto-casting for subdocument._id not work #31

Crotery opened this issue Sep 18, 2015 · 1 comment
Assignees
Labels

Comments

@Crotery
Copy link

Crotery commented Sep 18, 2015

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: Automattic/mongoose#3364 (comment)

@sieira
Copy link
Collaborator

sieira commented Nov 11, 2015

May have to fix the cloning stuff, I'll check that

@sieira sieira added the bug label Nov 11, 2015
@sieira sieira self-assigned this Nov 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants