{"id":20273832,"url":"https://github.com/lukaswilkeer/reproduce-hex-string-issue","last_synced_at":"2025-03-04T00:43:33.211Z","repository":{"id":149272559,"uuid":"229477298","full_name":"lukaswilkeer/reproduce-hex-string-issue","owner":"lukaswilkeer","description":null,"archived":false,"fork":false,"pushed_at":"2019-12-29T14:21:43.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T06:14:53.362Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukaswilkeer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-21T20:05:22.000Z","updated_at":"2019-12-29T14:21:45.000Z","dependencies_parsed_at":"2023-09-03T11:04:20.419Z","dependency_job_id":null,"html_url":"https://github.com/lukaswilkeer/reproduce-hex-string-issue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukaswilkeer%2Freproduce-hex-string-issue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukaswilkeer%2Freproduce-hex-string-issue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukaswilkeer%2Freproduce-hex-string-issue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukaswilkeer%2Freproduce-hex-string-issue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukaswilkeer","download_url":"https://codeload.github.com/lukaswilkeer/reproduce-hex-string-issue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241763755,"owners_count":20016162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T12:50:37.952Z","updated_at":"2025-03-04T00:43:33.186Z","avatar_url":"https://github.com/lukaswilkeer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reproduce-hex-string-issue\n\n### Reproduceble example of toHexString problem.\n\nThis issue was referenced at [automattic/mongoose #8423](https://github.com/Automattic/mongoose/issues/8423)\n\nThe problem could be solved using a middleware on get method of a model to convert the string of a BSON type to a hex string on init of project.\nusing the method `toString()`, removing the timestamp and the random number, or using `toHexString()` of a BSON buffer.\n[Mentioned here](https://github.com/Automattic/mongoose/issues/7968).\n\n[quote]\n```\n// Works if you put this line here\nmongoose.ObjectId.get(v =\u003e v.toString());\n```\n\n**To test:**\n\n`npm install`\n\n`npm test`\n\nBefore you'll need to import the mongo data, using mongoimport:\n\n```mongoimport --db=blink --collection=clocks```\n\n### Status\n\nCurrent fixed using .id intead ._id method.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukaswilkeer%2Freproduce-hex-string-issue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukaswilkeer%2Freproduce-hex-string-issue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukaswilkeer%2Freproduce-hex-string-issue/lists"}