{"id":23182026,"url":"https://github.com/owlycode/mongofixtures","last_synced_at":"2025-04-05T03:16:54.330Z","repository":{"id":57613799,"uuid":"12707701","full_name":"OwlyCode/mongofixtures","owner":"OwlyCode","description":"A Go quick and dirty utility for cleaning collections and loading fixtures into them.","archived":false,"fork":false,"pushed_at":"2013-10-23T23:18:07.000Z","size":128,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-10T11:23:13.812Z","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/OwlyCode.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}},"created_at":"2013-09-09T17:26:50.000Z","updated_at":"2022-01-04T17:26:30.000Z","dependencies_parsed_at":"2022-09-11T01:00:46.356Z","dependency_job_id":null,"html_url":"https://github.com/OwlyCode/mongofixtures","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/OwlyCode%2Fmongofixtures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OwlyCode%2Fmongofixtures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OwlyCode%2Fmongofixtures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OwlyCode%2Fmongofixtures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OwlyCode","download_url":"https://codeload.github.com/OwlyCode/mongofixtures/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280255,"owners_count":20912967,"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-12-18T08:19:10.680Z","updated_at":"2025-04-05T03:16:54.299Z","avatar_url":"https://github.com/OwlyCode.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"mongofixtures [![Build Status](https://travis-ci.org/OwlyCode/mongofixtures.png)](https://travis-ci.org/OwlyCode/mongofixtures)\n===============\nA Go quick and dirty utility for cleaning collections and loading fixtures into them.\n\nHow to install ?\n----------------\n\n```bash\ngo get github.com/OwlyCode/mongofixtures\n```\n\nHow to use ?\n------------\n\n```go\nsession, err := Begin(\"localhost\", \"database\")\ndefer session.End()\n\nif err != nil {\n  panic(err)\n}\n\n// Initial cleaning.\nsession.Clean(\"collection\")\n\n// Now population time !\nsession.Push(\"collection\", document{Id: bson.NewObjectId(), Title: \"This is a demo\"})\n\n// Load some yaml.\nsession.ImportYamlFile(\"test.yml\")\n```\n\nNote that Push and Clean can return both an error that you might want to check.\n\nYou can provide to the Begin function host parameter any string representing a mongo connection. For example : \"mongodb://myuser:mypass@localhost\" should work fine.\n\nNotes on YAML\n-------------\n\n/!\\ The short notation for arrays [] is not supported at the moment. /!\\\n\nYou can generate ids by using \\_\\_something\\_\\_. Every time mongofixtures sees a string matching \\_\\_(something)\\_\\_ it generates an ObjectId and stores it. If you use \\_\\_something\\_\\_ elsewhere mongofixtures will set the same ObjectId. Take a look a test.yml to view an example.\n\nWhat's on the todo ?\n--------------------\n- More tests !\n- Godoc the yml part\n- Improve yml support\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowlycode%2Fmongofixtures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowlycode%2Fmongofixtures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowlycode%2Fmongofixtures/lists"}