{"id":19596871,"url":"https://github.com/emmansun/extract-mgo-schema","last_synced_at":"2026-05-15T09:37:00.006Z","repository":{"id":65855087,"uuid":"132548792","full_name":"emmansun/extract-mgo-schema","owner":"emmansun","description":"golang extract mongodb schema tool","archived":false,"fork":false,"pushed_at":"2018-05-18T05:19:49.000Z","size":2165,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-09T07:31:48.894Z","etag":null,"topics":["extract-mongodb-schema","golang","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/emmansun.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}},"created_at":"2018-05-08T03:28:51.000Z","updated_at":"2018-05-18T05:19:50.000Z","dependencies_parsed_at":"2023-02-14T05:32:00.833Z","dependency_job_id":null,"html_url":"https://github.com/emmansun/extract-mgo-schema","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/emmansun%2Fextract-mgo-schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmansun%2Fextract-mgo-schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmansun%2Fextract-mgo-schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmansun%2Fextract-mgo-schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emmansun","download_url":"https://codeload.github.com/emmansun/extract-mgo-schema/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240876832,"owners_count":19871904,"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":["extract-mongodb-schema","golang","mongodb"],"created_at":"2024-11-11T08:56:58.598Z","updated_at":"2026-05-15T09:36:59.962Z","avatar_url":"https://github.com/emmansun.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a golang tool to extract mongodb schema. The main steps are:\n\n1. List all collections from mongdodb database\n2. Handle collection one by one\n\t1. Select 100 documents and analysis document's fields type according object real type. Using []bson.D as result type: `\tvar results []bson.D \n\terr := c.Find(bson.M{}).Limit(MaxTryRecords).Sort(\"-_id\").All(\u0026results)`\n\t1. For slice []interface{}, also handle at most 100 records.\n\t1. Handle bson.D as embedded document.\n\nDepends on \n\n\n1. [https://github.com/globalsign/mgo](https://github.com/globalsign/mgo \"golang mongodb driver\")\n2. [https://gopkg.in/urfave/cli.v1](https://gopkg.in/urfave/cli.v1 \"command line go application\")\n\n**Sample command**: extract_mgo.exe -database mongodb://db_owner:db_owner@localhost:47017/sampledb -format csv -output mongo_schema.csv","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmansun%2Fextract-mgo-schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femmansun%2Fextract-mgo-schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmansun%2Fextract-mgo-schema/lists"}