{"id":15793323,"url":"https://github.com/pinzolo/mongotest","last_synced_at":"2025-06-13T05:32:25.130Z","repository":{"id":43413754,"uuid":"205698195","full_name":"pinzolo/mongotest","owner":"pinzolo","description":"Testing helper for using MongoDB.","archived":false,"fork":false,"pushed_at":"2023-09-19T00:47:19.000Z","size":31,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T11:53:26.860Z","etag":null,"topics":["fixtures","golang","mongodb","testing"],"latest_commit_sha":null,"homepage":"","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/pinzolo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-09-01T15:48:01.000Z","updated_at":"2024-02-03T16:58:55.000Z","dependencies_parsed_at":"2024-10-04T23:10:41.907Z","dependency_job_id":null,"html_url":"https://github.com/pinzolo/mongotest","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pinzolo/mongotest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinzolo%2Fmongotest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinzolo%2Fmongotest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinzolo%2Fmongotest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinzolo%2Fmongotest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pinzolo","download_url":"https://codeload.github.com/pinzolo/mongotest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinzolo%2Fmongotest/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259589169,"owners_count":22880919,"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":["fixtures","golang","mongodb","testing"],"created_at":"2024-10-04T23:10:37.024Z","updated_at":"2025-06-13T05:32:25.109Z","avatar_url":"https://github.com/pinzolo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mongotest\n\n[![Test](https://github.com/pinzolo/mongotest/actions/workflows/test.yml/badge.svg)](https://github.com/pinzolo/mongotest/actions/workflows/test.yml)\n[![Coverage Status](https://coveralls.io/repos/github/pinzolo/mongotest/badge.svg?branch=master)](https://coveralls.io/github/pinzolo/mongotest?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/pinzolo/mongotest)](https://goreportcard.com/report/github.com/pinzolo/mongotest)\n[![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/pinzolo/mongotest)\n[![license](http://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/pinzolo/mongotest/master/LICENSE)\n\n## Description\n\nmongotest is testing helper for using MongoDB.\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pinzolo/mongotest\"\n)\n\nfunc main() {\n\tmongotest.Configure(mongotest.Config{\n\t\tURL:            \"mongodb://root:password@127.0.0.1:27017\",\n\t\tDatabase:       \"mongotest\",\n\t\tFixtureRootDir: \"testdata\",\n\t\tFixtureFormat:  mongotest.FixtureFormatJSON,\n\t\tPreInsertFuncs: []mongotest.PreInsertFunc{\n\t\t\tmongotest.SimpleConvertTime(\"users\", \"created_at\"),\n\t\t},\n\t})\n\n\t// 1. Read testdata/json/admin_users.json and testdata/json/foo_users.json\n\t// 2. Merge read data\n\t// 3. Drop collection and insert read data\n\terr := mongotest.UseFixture(\"json/admin_users\", \"json/foo_users\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Count is helper function.\n\t// mongotest has some useful helper functions.\n\tn, err := mongotest.Count(\"users\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(n)\n}\n```\n\n## Install\n\n```bash\n$ go get github.com/pinzolo/mongotest\n```\n\n## Contribution\n\n1. Fork ([https://github.com/pinzolo/mongotest/fork](https://github.com/pinzolo/mongotest/fork))\n1. Create a feature branch\n1. Commit your changes\n1. Rebase your local changes against the master branch\n1. Run test suite with the `go test ./...` command and confirm that it passes\n1. Run `gofmt -s`\n1. Create a new Pull Request\n\n## Author\n\n[pinzolo](https://github.com/pinzolo)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinzolo%2Fmongotest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpinzolo%2Fmongotest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinzolo%2Fmongotest/lists"}