{"id":23381133,"url":"https://github.com/dasfmi/shorba","last_synced_at":"2025-04-08T08:19:51.408Z","repository":{"id":213452037,"uuid":"57070089","full_name":"dasfmi/shorba","owner":"dasfmi","description":null,"archived":false,"fork":false,"pushed_at":"2016-11-13T12:06:28.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-14T05:19:53.440Z","etag":null,"topics":["dummy","fixtures","go","mongodb"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/dasfmi.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":"2016-04-25T19:32:02.000Z","updated_at":"2019-04-12T11:46:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"fcf084fb-96fd-45cc-9d15-4e1b177c6895","html_url":"https://github.com/dasfmi/shorba","commit_stats":null,"previous_names":["objectizer/shorba","dasfmi/shorba"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasfmi%2Fshorba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasfmi%2Fshorba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasfmi%2Fshorba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasfmi%2Fshorba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dasfmi","download_url":"https://codeload.github.com/dasfmi/shorba/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247801160,"owners_count":20998339,"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":["dummy","fixtures","go","mongodb"],"created_at":"2024-12-21T20:39:50.843Z","updated_at":"2025-04-08T08:19:51.380Z","avatar_url":"https://github.com/dasfmi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Shorba\n\nShorba is a small tool to generate dummy/fake data in Go based on struct (serving as model) and insert those data into mongodb.\n\nlet's suppose you have a struct like that:\n\n\ttype Post struct {\n\t\tID string `bson:\"_id,omitempty\"`\n\t\tTitle string `bson:\"title\"`\n\t\tContent string `bson:\"content\"`\n\t\tPublishDate time.Time `bson:\"publishDate\"`\n\t}\n\n\nand you want to populate 200 fake posts for testing and develpoment purposes,\nyou can use shorba to do that for you, like this:\n\n\tpostModel := \u0026Post{}\n\tshorba.populate(\"posts\", \u0026postModel, 200)\n\n\nthis should generate 200 different posts and insert them into collection 'posts'\n\n\n####Usage\n\nfirst install shorba\n\n\tgo get github.com/eslammostafa/shorba\n\nimport it\n\n\timport (\n\t\t...\n\t\t\"github.com/eslammostafa/shorba\"\n\t)\n\nconnect to your mongodb\n\n\tshorba.Connect(\"localhost\", \"username\", \"password\", \"dbname\")\n\n if there is no username nor password write \"\" instead of each one\n\n \tshorba.Connect(\"localhost\", \"\", \"\", \"dbname\")\n\n\npopulate data\n\n\tpostModel := \u0026Post{}\n\tshorba.populate(\"posts\", \u0026postModel, 135)\n\n\n#### TODO\n\n* Support arrays\n* Support Embedded Documents\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdasfmi%2Fshorba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdasfmi%2Fshorba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdasfmi%2Fshorba/lists"}