{"id":15710192,"url":"https://github.com/topfullstack/nestjs-crud-mongoose","last_synced_at":"2025-08-03T10:05:54.566Z","repository":{"id":57310117,"uuid":"211261544","full_name":"topfullstack/nestjs-crud-mongoose","owner":"topfullstack","description":"mongoose service adapter for @nestjsx/crud","archived":false,"fork":false,"pushed_at":"2024-02-27T02:52:26.000Z","size":16,"stargazers_count":9,"open_issues_count":2,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T01:40:07.291Z","etag":null,"topics":["crud","mongoose","nestjs","restful-api","typegoose"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/topfullstack.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-27T07:30:01.000Z","updated_at":"2024-02-02T15:03:40.000Z","dependencies_parsed_at":"2024-10-27T13:06:29.618Z","dependency_job_id":null,"html_url":"https://github.com/topfullstack/nestjs-crud-mongoose","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"1f43f0ce63b060b55ea92163f9367d697f7618ad"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/topfullstack/nestjs-crud-mongoose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfullstack%2Fnestjs-crud-mongoose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfullstack%2Fnestjs-crud-mongoose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfullstack%2Fnestjs-crud-mongoose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfullstack%2Fnestjs-crud-mongoose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/topfullstack","download_url":"https://codeload.github.com/topfullstack/nestjs-crud-mongoose/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfullstack%2Fnestjs-crud-mongoose/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268525073,"owners_count":24264095,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["crud","mongoose","nestjs","restful-api","typegoose"],"created_at":"2024-10-03T21:04:27.111Z","updated_at":"2025-08-03T10:05:54.501Z","avatar_url":"https://github.com/topfullstack.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nestjs-crud-mongoose\nMongoose/Typegoose service adapter for [@nestjsx/crud](https://github.com/nestjsx/crud)\n\n\u003e Nest.js + typegoose video (chinese):\n\u003e \n\u003e Nest.js + Typegoose 中文视频教程请移步哔哩哔哩全栈之巅:\n\u003e\n\u003e https://space.bilibili.com/341919508\n\n\n## How to\n\n### Install\n\n```bash\nyarn add nestjs-crud-mongoose\n# or\nnpm i nestjs-crud-mongoose\n```\n\n### Create a service based on a mongoose/typegoose model\n`/src/users/users.service.ts`\n\n```ts\n// for typegoose users\nimport { User } from \"../../common/users/user.model\";\nimport { Injectable, Inject } from \"@nestjs/common\";\nimport { ModelType } from \"@typegoose/typegoose/lib/types\";\nimport { MongooseCrudService } from \"./mongoose-crud.service\";\n\n@Injectable()\nexport class UsersService extends MongooseCrudService\u003cUser\u003e{\n  constructor(@Inject('UserModel') public model: ModelType\u003cUser\u003e) {\n    super(model)\n  }\n}\n```\n\nOR\n\n```ts\n// for mongoose users\nimport { User } from \"../../common/users/user.model\";\nimport { Injectable, Inject } from \"@nestjs/common\";\nimport { Model } from \"mongoose\";\nimport { MongooseCrudService } from \"./mongoose-crud.service\";\n\n@Injectable()\nexport class UsersService extends MongooseCrudService\u003cUser\u003e{\n  constructor(@Inject('UserModel') public model: Model\u003cUser\u003e) {\n    super(model)\n  }\n}\n\n```\n\n### Inject `UsersService` to your `UsersController`:\n\n```ts\n@Crud({\n  // ...\n})\nexport class UsersController {\n  constructor(public service: UsersService) { }\n}\n```\n\n\n## Thanks to\n\n- https://github.com/nestjsx/crud\n- https://github.com/nestjsx/crud/tree/master/packages/crud-typeorm\n\n## Related docs\n- https://github.com/nestjsx/crud/wiki/ServiceTypeorm","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopfullstack%2Fnestjs-crud-mongoose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftopfullstack%2Fnestjs-crud-mongoose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopfullstack%2Fnestjs-crud-mongoose/lists"}