{"id":26934368,"url":"https://github.com/mdevpro78/pymongo-wrapper","last_synced_at":"2025-09-11T10:44:26.213Z","repository":{"id":172728380,"uuid":"649674610","full_name":"Mdevpro78/pymongo-wrapper","owner":"Mdevpro78","description":"schemaless pymongo wrapper to make the advance mongodb query based on the pymongo package","archived":false,"fork":false,"pushed_at":"2025-01-02T14:11:25.000Z","size":48,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T10:41:14.251Z","etag":null,"topics":["django","mongodb","pymongo","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Mdevpro78.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":"2023-06-05T11:48:34.000Z","updated_at":"2025-01-02T14:11:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"3cbc9441-7899-4de7-b354-788c9670464c","html_url":"https://github.com/Mdevpro78/pymongo-wrapper","commit_stats":null,"previous_names":["mdevpro78/pymongo-wrapper","mdevpro78/pymongo_wrapper"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Mdevpro78/pymongo-wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mdevpro78%2Fpymongo-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mdevpro78%2Fpymongo-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mdevpro78%2Fpymongo-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mdevpro78%2Fpymongo-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mdevpro78","download_url":"https://codeload.github.com/Mdevpro78/pymongo-wrapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mdevpro78%2Fpymongo-wrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274618814,"owners_count":25318746,"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-09-11T02:00:13.660Z","response_time":74,"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":["django","mongodb","pymongo","python"],"created_at":"2025-04-02T10:36:51.032Z","updated_at":"2025-09-11T10:44:26.171Z","avatar_url":"https://github.com/Mdevpro78.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"\" rel=\"noopener\"\u003e\n \u003cimg width=200px height=200px src=\"./logo.png\" alt=\"Project logo\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003ePymongo Wrapper\u003c/h3\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![Status](https://img.shields.io/badge/status-active-success.svg)]()\n[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/kylelobo/The-Documentation-Compendium.svg)](https://github.com/kylelobo/The-Documentation-Compendium/pulls)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)\n\n\u003c/div\u003e\n\n---\n\n\u003cp align=\"center\"\u003e\n    \u003cbr\u003e \n\tThis Python Package called PyMongo Wrapper wrapp the Pymongo python package for projects which are schemaless\n\u003c/p\u003e\n\n## 📝 Table of Contents\n\n- [About](#about)\n- [Getting Started](#getting_started)\n- [Usage](#usage)\n- [Built Using](#built_using)\n- [Authors](#authors)\n\n## 🧐 About\n\nPyMongo Wrapper provides a simple wrapper around pymongo which is providing CRUD functionality on the MongoDB\nwhen we don't have Schema (Schemaless)\n\n## 🏁 Getting Started \n\n### Prerequisites\n\nWhat things you need to install the software and how to install them.\n\n```bash\ngit clone https://github.com/Mdevpro78/pymongo-wrapper.git\n```\n\n### Installing\n\nA step by step series to install the package\n\n```bash\ncd pymongo-wrapper\n```\n\n```bash\npython setup.py install\n```\n\nor just\n\n```bash\npip install .\n```\n\n## 🎈 Usage \n\n### for Python Project\n\n#### to build Db Repository\n\n```bash\nfrom repository import DBRepository\n\ncollection_name = 'my_collection'\ndatabase_name = 'my_database'\nuri = 'mongodb://localhost:27017/'\n\ndb_repo = DBRepository(collection_name, database_name, uri)\n\n```\n\n#### To build Pipeline\n\n```bash\n# Instantiate the pipeline builder\nbuilder = PipelineBuilder()\n\n# Add a $match stage\nbuilder.match({'name': 'John'})\n\n# Add a $project stage\nbuilder.project({'name': 1, 'age': 1})\n\n# Add a $group stage\nbuilder.group(['name'], count={'$sum': 1})\n\n# Add a $sort stage\nbuilder.sort([('count', -1), ('name', 1)])\n\n# Add a $skip stage\nbuilder.skip(10)\n\n# Add a $limit stage\nbuilder.limit(5)\n\n# Add a $unwind stage\nbuilder.unwind('$tags')\n\n# Build the pipeline\npipeline = builder.build()\n\n```\n\n#### Example\n\n```\n# Example usage of query_repo()\nquery_repo = db_repo.query_repo()\nresults = query_repo.aggregate(pipeline)\nfor result in results:\n    print(result)\n\n```\n\n## ⛏️ Built Using \n\n- [MongoDB](https://www.mongodb.com/) - MongoDB\n- [Django](https://www.djangoproject.com/) - Django\n- [PyMongo](https://pymongo.readthedocs.io/en/stable/index.html) - MongoDB python Driver\n\n## ✍️ Authors \n\n- [@MdevPro](https://github.com/Mdevpro78/pymongo-wrapper)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdevpro78%2Fpymongo-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdevpro78%2Fpymongo-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdevpro78%2Fpymongo-wrapper/lists"}