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

Not work ObjectId.isValid function #3363

Closed
inthedark122 opened this issue Sep 11, 2015 · 2 comments
Closed

Not work ObjectId.isValid function #3363

inthedark122 opened this issue Sep 11, 2015 · 2 comments

Comments

@inthedark122
Copy link

When I check valid ObjectId

> console.log(mongoose.Types.ObjectId.isValid('test@mail.ru'));
true

I get result true. But if I execute this query then I have error.
Why is this happening?

@inthedark122 inthedark122 changed the title Not work .ObjectId.isValid function Not work ObjectId.isValid function Sep 11, 2015
@inthedark122
Copy link
Author

#1959

@vkarpov15
Copy link
Collaborator

https://github.com/mongodb/js-bson/issues/112 as well. Any 12 character string is technically a valid mongodb objectid under the hood, however, mongoose casting doesn't handle that case. I'll open up a separate issue, #3365, to track this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants