{"comment":{"created_at":"2011-10-13T00:34:07Z","body":"I know get a Error: Invalid ObjectId ... any ideas?","updated_at":"2011-10-13T00:34:07Z","url":"https://api.github.com/repos/LearnBoost/mongoose/issues/comments/2389983","id":2389983,"user":{"avatar_url":"https://secure.gravatar.com/avatar/73749d2abd807d124e99a134cda25790?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/guiomie","id":885317,"login":"guiomie"}},"action":"created","issue":{"number":447,"created_at":"2011-08-06T19:17:00Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Hi all,\r\nthis is more a question than an issue (mongoose newbie) but could someone point me to an example of how to use custom ObectIds with mongoose?\r\nwhenever I properly define, i.e. _id: mongoose.Schema.ObjectId in a schema and then try to create the ObjectId with a custom key, i.e. myModel._id = new ObjectId('unique'), I get an invalid ObjectId error. \r\n\r\nUsing Strings as _id and automatic ObjectIds generated by mongoose works well, but I really need custom (and unique) keys for the ObjectIds within my models and want to use the DBRef plugin to make proper references in mongodb between collections.\r\n\r\nAny hints?\r\nThanks in advance for your help!","comments":5,"title":"Custom ObjectIds - How to?","updated_at":"2011-10-13T00:34:07Z","url":"https://api.github.com/repos/LearnBoost/mongoose/issues/447","id":1358693,"assignee":null,"milestone":null,"closed_at":"2011-09-07T18:45:21Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/61aa94bacdc50d1c93636adf348af1eb?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/peterpaulrubens","id":208534,"login":"peterpaulrubens"},"html_url":"https://github.com/LearnBoost/mongoose/issues/447","labels":[],"state":"closed"},"legacy":{"issue_id":1358693,"comment_id":2389983}}