{"action":"closed","issue":{"url":"https://api.github.com/repos/mongodb/js-bson/issues/140","labels_url":"https://api.github.com/repos/mongodb/js-bson/issues/140/labels{/name}","comments_url":"https://api.github.com/repos/mongodb/js-bson/issues/140/comments","events_url":"https://api.github.com/repos/mongodb/js-bson/issues/140/events","html_url":"https://github.com/mongodb/js-bson/issues/140","id":101469649,"number":140,"title":"ObjectId.isValid should return true when number ?","user":{"login":"alexserver","id":694404,"avatar_url":"https://avatars.githubusercontent.com/u/694404?v=3","gravatar_id":"","url":"https://api.github.com/users/alexserver","html_url":"https://github.com/alexserver","followers_url":"https://api.github.com/users/alexserver/followers","following_url":"https://api.github.com/users/alexserver/following{/other_user}","gists_url":"https://api.github.com/users/alexserver/gists{/gist_id}","starred_url":"https://api.github.com/users/alexserver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexserver/subscriptions","organizations_url":"https://api.github.com/users/alexserver/orgs","repos_url":"https://api.github.com/users/alexserver/repos","events_url":"https://api.github.com/users/alexserver/events{/privacy}","received_events_url":"https://api.github.com/users/alexserver/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-17T17:27:44Z","updated_at":"2015-10-15T07:13:13Z","closed_at":"2015-10-15T07:13:13Z","body":"I'm relying on ObjectId.isValid function to validate my ObjectID string representations.\r\nI read that this module is widely used in mongo libraries, so for every ObjectID I'm expecting to receive a 24 hex characters string.\r\nBut when I run `ObjectId.isValid( <any number> )` this is returning true.\r\nHere the code that does that: https://github.com/mongodb/js-bson/blob/master/lib/bson/objectid.js#L244-L245\r\n\r\nShouldn't this avoid numbers as ObjectId and instead only 24 chars representations ?"}}