-
Notifications
You must be signed in to change notification settings - Fork 33
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
ObjectID.isValid function return true for number #39
Comments
Can you submit a PR to fix this? |
Hey there @niftylettuce I have a suggested resolution to this based on how the mongoose library has tackled this. They created a new method to address the issue, so they now have:
Here is a great write-up on the issues they encountered: Automattic/mongoose#11419 Thanks! |
@supersime it also seems that Mongoose will return |
> require('bson-objectid').isValid('192.168.1.20')
true
> require('mongoose').Types.ObjectId.isValid('192.168.1.20')
true |
We should probably update this repo to use the approach with hex string and 24 char length as per |
Hi,
I have problem with
ObjectID.isValid
function which returns true for number. I think that number is not valid ObjectID or I miss something important. I found that behaviour when I update to v@2.0.1.The text was updated successfully, but these errors were encountered: