{"id":37119807,"url":"https://github.com/onsdigital/dp-mongodb","last_synced_at":"2026-01-14T13:58:26.358Z","repository":{"id":38360177,"uuid":"232822265","full_name":"ONSdigital/dp-mongodb","owner":"ONSdigital","description":"A mongo db library for Go.","archived":false,"fork":false,"pushed_at":"2025-12-18T09:28:21.000Z","size":563,"stargazers_count":3,"open_issues_count":3,"forks_count":3,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-12-20T23:40:02.807Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ONSdigital.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-01-09T14:01:45.000Z","updated_at":"2025-12-18T09:28:22.000Z","dependencies_parsed_at":"2024-06-19T01:41:39.547Z","dependency_job_id":null,"html_url":"https://github.com/ONSdigital/dp-mongodb","commit_stats":null,"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/ONSdigital/dp-mongodb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONSdigital%2Fdp-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONSdigital%2Fdp-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONSdigital%2Fdp-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONSdigital%2Fdp-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ONSdigital","download_url":"https://codeload.github.com/ONSdigital/dp-mongodb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONSdigital%2Fdp-mongodb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28422388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-14T13:58:24.009Z","updated_at":"2026-01-14T13:58:26.344Z","avatar_url":"https://github.com/ONSdigital.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dp-mongodb\n\nA mongodb library for DP.\n\n## Getting started\n\n### Setting up mongo\n\nUsing brew, type brew install mongo or the latest binaries can be downloaded [here](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/#install-mongodb-community-edition-with-homebrew)\n\n### Running mongo\n\nFollow instructions from mongo db [manual](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/#run-mongodb)\n\n## health package\n\nThe mongo checker function currently pings the mongo client, and checks that all collections given when the checker was created, actually exist.\n\nRead the [Health Check Specification](https://github.com/ONSdigital/dp/blob/master/standards/HEALTH_CHECK_SPECIFICATION.md) for details.\n\nInstantiate a mongo health checker\n\n```go\nimport mongoHealth \"github.com/ONSdigital/dp-mongo/health\"\nimport mongoDriver \"github.com/ONSdigital/dp-mongo/mongodb\"\n\n...\n\n    healthClient := mongoHealth.NewClientWithCollections(\u003cmongoDriver.MongoConnection\u003e, \u003cmap[mongoHealth.Database][]mongoHealth.Collection\u003e)\n\n...\n```\n\nCalling mongo health checker: `healthClient.Checker(context.Context, *healthcheck.CheckState)` will fill out the check object like so:\n\n```json\n{\n    \"name\": \"string\",\n    \"status\": \"string\",\n    \"message\": \"string\",\n    \"last_checked\": \"ISO8601 - UTC date time\",\n    \"last_success\": \"ISO8601 - UTC date time\",\n    \"last_failure\": \"ISO8601 - UTC date time\"\n}\n```\n\n## Configuration\n\nConfiguration of the health check takes place via arguments passed to the `NewClient() or NewClientWithCollections()` functions\n\n## Tools\n\nTo run some of our tests you will need additional tooling:\n\n### Audit\n\nWe use `dis-vulncheck` to do auditing, which you will [need to install](https://github.com/ONSdigital/dis-vulncheck).\n\n### Tests\n\nThe tests (both unit and component) for this library use [testcontainers](https://golang.testcontainers.org/modules/mongodb/) to run a mongodb Docker container. To run them you will need to have a Docker daemon running (e.g. colima).\n\n## Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## License\n\nCopyright © 2024, Office for National Statistics (https://www.ons.gov.uk)\n\nReleased under MIT license, see [LICENSE](LICENSE.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonsdigital%2Fdp-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonsdigital%2Fdp-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonsdigital%2Fdp-mongodb/lists"}