{"id":47344775,"url":"https://github.com/sinksmell/hamster","last_synced_at":"2026-03-17T23:10:30.816Z","repository":{"id":40349944,"uuid":"487779968","full_name":"sinksmell/hamster","owner":"sinksmell","description":"fluent MQL(MongoDB Query Language) generation for golang","archived":false,"fork":false,"pushed_at":"2022-05-13T15:11:59.000Z","size":24,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T22:33:54.391Z","etag":null,"topics":["bson","golang","mongodb","mongodb-driver-tool","mql"],"latest_commit_sha":null,"homepage":"https://sinksmell.github.io/hamster/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sinksmell.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":"2022-05-02T09:04:06.000Z","updated_at":"2022-05-05T03:45:24.000Z","dependencies_parsed_at":"2022-08-09T17:51:03.347Z","dependency_job_id":null,"html_url":"https://github.com/sinksmell/hamster","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sinksmell/hamster","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinksmell%2Fhamster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinksmell%2Fhamster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinksmell%2Fhamster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinksmell%2Fhamster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinksmell","download_url":"https://codeload.github.com/sinksmell/hamster/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinksmell%2Fhamster/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30635156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T22:38:22.569Z","status":"ssl_error","status_checked_at":"2026-03-17T22:38:11.804Z","response_time":56,"last_error":"SSL_read: 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":["bson","golang","mongodb","mongodb-driver-tool","mql"],"created_at":"2026-03-17T23:10:27.914Z","updated_at":"2026-03-17T23:10:30.806Z","avatar_url":"https://github.com/sinksmell.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hamster - fluent MQL generator for Go\n## Hamster is in evolution.\n\nInspired by:\n- [squirrel](https://github.com/Masterminds/squirrel)\n- [mongodb-driver-java](https://github.com/mongodb/mongo-java-driver)\n\nMQL Builder TODO:\n- [x] Filter Builder\n- [x] Sort Builder\n- [ ] Projection Builder\n- [ ] Update Builder\n- [ ] Aggregate Builder\n- [ ] Index Builder\n\n\n## Usage\n\n### Filter \u0026 Sort\n[Official-Filters-Builder](https://www.mongodb.com/docs/drivers/java/sync/v4.6/fundamentals/builders/filters/#std-label-filters-builders)\n\n```go\n\timport \"github.com/sinksmell/hamster\"\n\n\tctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\tdefer cancel()\n\tclient, err := mongo.Connect(ctx, options.Client().ApplyURI(\"mongodb://127.0.0.1:27017\"))\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\topt := options.Find()\n\tfilter := hamster.FilterDocBuilder.Gt(\"year\", 2000).Type(\"imdb.rating\", bsontype.Double.String()).Doc()\n\tsort := hamster.SortDocBuilder.OrderBy(\"year\", hamster.SortDesc).OrderDescBy(\"imdb.rating\").Doc()\n\topt.SetSort(sort)\n\topt.SetLimit(10)\n\tcursor, err := client.Database(\"sample_mflix\").Collection(\"movies\").Find(ctx, filter, opt)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\ttype movie struct {\n\t\tTitle string `bson:\"title\"`\n\t\tYear  int    `bson:\"year\"`\n\t}\n\tvar data []movie\n\tdefer cursor.Close(context.TODO())\n\n```\n\n\n## License\n\nHamster is released under the\n[Apache License]( http://www.apache.org/licenses/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinksmell%2Fhamster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinksmell%2Fhamster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinksmell%2Fhamster/lists"}