{"id":18441154,"url":"https://github.com/onesy-me/mongo","last_synced_at":"2026-02-06T18:32:55.943Z","repository":{"id":41101370,"uuid":"455232604","full_name":"onesy-me/mongo","owner":"onesy-me","description":"Mongo ","archived":false,"fork":false,"pushed_at":"2025-11-05T17:41:42.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-05T19:39:14.042Z","etag":null,"topics":["amaui","back-end","backend","express","expressjs","javascript","js","mongo","mongodb","node","nodejs","typescript","utils","web"],"latest_commit_sha":null,"homepage":"https://docs.onesy.me/library/mongo","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/onesy-me.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-02-03T16:05:19.000Z","updated_at":"2025-11-05T17:41:45.000Z","dependencies_parsed_at":"2023-09-26T21:31:25.032Z","dependency_job_id":"e727564c-b7ed-4616-bd48-e91217c8d300","html_url":"https://github.com/onesy-me/mongo","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"110cb4c2baa2564a6111218df24e117f3f679575"},"previous_names":["onesy-me/mongo","amaui-org/amaui-mongo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/onesy-me/mongo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onesy-me%2Fmongo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onesy-me%2Fmongo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onesy-me%2Fmongo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onesy-me%2Fmongo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onesy-me","download_url":"https://codeload.github.com/onesy-me/mongo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onesy-me%2Fmongo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29172617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T16:33:35.550Z","status":"ssl_error","status_checked_at":"2026-02-06T16:33:30.716Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["amaui","back-end","backend","express","expressjs","javascript","js","mongo","mongodb","node","nodejs","typescript","utils","web"],"created_at":"2024-11-06T06:35:12.154Z","updated_at":"2026-02-06T18:32:55.936Z","avatar_url":"https://github.com/onesy-me.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003c/br\u003e\n\u003c/br\u003e\n\n\u003cp align='center'\u003e\n  \u003ca target='_blank' rel='noopener noreferrer' href='#'\u003e\n    \u003cimg width='auto' height='84' src='https://raw.githubusercontent.com/onesy-me/onesy/refs/heads/main/utils/images/logo.png' alt='onesy logo' /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align='center'\u003eonesy Mongo\u003c/h1\u003e\n\n\u003ch3 align='center'\u003e\n  \u003csub\u003eMIT license\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003eProduction ready\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003e100% test cov\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003eNodejs\u003c/sub\u003e\n\u003c/h3\u003e\n\n\u003cp align='center'\u003e\n    \u003csub\u003eVery simple code\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n    \u003csub\u003eModern code\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n    \u003csub\u003eJunior friendly\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n    \u003csub\u003eTypescript\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n    \u003csub\u003eMade with :yellow_heart:\u003c/sub\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n### Add\n\n```sh\nyarn add @onesy/mongo\n```\n\nAdd `mongodb` as a peer dependency\n\n```sh\nyarn add mongodb\n```\n\n### Use\n\n```javascript\n  import { Mongo, BaseCollection } from '@onesy/mongo';\n  // Make if you wanna a config file and\n  // inside of it add all the process.env related props\n  import Config from './config';\n\n  // Make a new mongo instance\n  const mongo = new Mongo({\n    uri: Config.db.mongo.uri,\n    name: Config.db.mongo.name,\n  });\n\n  await mongo.connection;\n\n  // Make a collection class\n  class TodoCollection extends BaseCollection {\n\n    public constructor() {\n      super('todos', mongo);\n    }\n\n  }\n\n  const todoCollection = new TodoCollection();\n\n  // Add\n  const todoCreated = await todoCollection.addOne({\n    name: 'todo',\n    description: 'description'\n  });\n\n  // Find one\n  const todo = await aCollection.findOne({\n    _id: todoCreated._id\n  });\n\n  todo;\n\n  // {\n  //   _id: ObjectId('407f191e810c19729de860ea'),\n  //   name: 'todo',\n  //   description: 'description',\n  //   added_at: 1777044477\n  // }\n\n  // etc.\n```\n\n### Dev\n\nInstall\n\n```sh\nyarn\n```\n\nTest\n\n```sh\nyarn test\n```\n\n#### One time local setup\n\nInstall docker and docker-compose\n\n  - https://docs.docker.com/get-docker\n  - https://docs.docker.com/compose/install\n\nMake docker containers\n\n```sh\nyarn docker\n```\n\n(mac) Add lines below to */private/etc/hosts*\n```\n127.0.0.1   mongo1\n127.0.0.1   mongo2\n127.0.0.1   mongo3\n127.0.0.1   mongo1-test\n127.0.0.1   mongo2-test\n127.0.0.1   mongo3-test\n```\n\n### Prod\n\nBuild\n\n```sh\nyarn build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonesy-me%2Fmongo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonesy-me%2Fmongo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonesy-me%2Fmongo/lists"}