{"id":15434573,"url":"https://github.com/well2333/nonebot-plugin-mongodb","last_synced_at":"2025-04-19T18:09:51.414Z","repository":{"id":181181485,"uuid":"665023454","full_name":"Well2333/nonebot-plugin-mongodb","owner":"Well2333","description":"基于 MongoDB ODM 的数据库管理插件","archived":false,"fork":false,"pushed_at":"2023-07-14T10:31:03.000Z","size":234,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-18T08:54:12.832Z","etag":null,"topics":["beanie","mongodb","nonebot-plugin","nonebot2"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Well2333.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}},"created_at":"2023-07-11T09:13:03.000Z","updated_at":"2024-07-06T06:52:35.000Z","dependencies_parsed_at":"2023-07-14T11:51:02.524Z","dependency_job_id":null,"html_url":"https://github.com/Well2333/nonebot-plugin-mongodb","commit_stats":null,"previous_names":["well2333/nonebot-plugin-mongodb"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Well2333%2Fnonebot-plugin-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Well2333%2Fnonebot-plugin-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Well2333%2Fnonebot-plugin-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Well2333%2Fnonebot-plugin-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Well2333","download_url":"https://codeload.github.com/Well2333/nonebot-plugin-mongodb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249759044,"owners_count":21321650,"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":["beanie","mongodb","nonebot-plugin","nonebot2"],"created_at":"2024-10-01T18:40:01.730Z","updated_at":"2025-04-19T18:09:51.394Z","avatar_url":"https://github.com/Well2333.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://www.mongodb.com/\"\u003e\u003cimg src=\"docs/mongo.png\" width=\"180\" height=\"180\" alt=\"NoneBotPluginLogo\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n# nonebot-plugin-mongodb\n\n_✨ 基于 MongoDB ODM 的数据库管理插件 ✨_\n\n\u003ca href=\"./LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/Well2333/nonebot-plugin-mongodb.svg\" alt=\"license\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://pypi.python.org/pypi/nonebot-plugin-mongodb\"\u003e\n  \u003cimg alt=\"PyPI - Downloads\" src=\"https://img.shields.io/pypi/dm/nonebot-plugin-mongodb\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://pypi.python.org/pypi/nonebot-plugin-mongodb\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/nonebot-plugin-mongodb.svg\" alt=\"pypi\"\u003e\n\u003c/a\u003e\n\n\u003cimg src=\"https://img.shields.io/badge/python-3.8+-blue.svg\" alt=\"python\"\u003e\n\n\u003ca href=\"https://pdm.fming.dev\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/pdm-managed-blueviolet\" alt=\"pdm-managed\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://github.com/psf/black\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/code%20style-black-000000.svg\" alt=\"Code style: black\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://jq.qq.com/?_wv=1027\u0026k=5OFifDh\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/QQ%E7%BE%A4-768887710-orange?style=flat-square\" alt=\"QQ Chat Group\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://jq.qq.com/?_wv=1027\u0026k=7LWx6q4J\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/QQ%E7%BE%A4-720053992-orange?style=flat-square\" alt=\"QQ Chat Group\"\u003e\n\u003c/a\u003e\n\n\u003c/div\u003e\n\n## 💿 安装\n\n\u003e 如果你不是插件开发者，那么此插件一般不需要额外安装和加载\n\n\u003cdetails\u003e\n\u003csummary\u003epip\u003c/summary\u003e\n\n    pip install nonebot-plugin-mongodb\n\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003epdm\u003c/summary\u003e\n\n    pdm add nonebot-plugin-mongodb\n\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003epoetry\u003c/summary\u003e\n\n    poetry add nonebot-plugin-mongodb\n\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003econda\u003c/summary\u003e\n\n    conda install nonebot-plugin-mongodb\n\n\u003c/details\u003e\n\n在你的插件中添加对应的 require 以确保此插件在被引用前正确加载\n\n```\nfrom nonebot import require\n\nrequire(\"nonebot_plugin_mongodb\")\n```\n\n## ⚙️ 配置\n\n在 nonebot2 项目的`.env`文件中添加下表中的配置, 配置均为**非必须项**\n\n### 通用配置项\n\n|       配置项        | 必填 | 类型 |  默认值  |        说明        |\n| :-----------------: | :--: | :--: | :------: | :----------------: |\n|      mongo_uri      |  ⭕  | str  |   None   | MongoDB 的连接 uri |\n| mongo_database_name |  ❌  | str  | nonebot2 |   连接的数据库名   |\n\n## 🎉 使用\n\n\u003e 如果你不是插件开发者，那么此部分无需阅读\n\n\u003e 参考 exmple 中的[示例代码](./example/beanie_usage.py)\n\n在 nonebot 的 `startup` 阶段时，本插件会读取 `beanie.Document` 的全部子类并加载，因此开发者无需额外进行 `init_beanie` 即可直接使用，关于具体的操作方法可以参考 [beanie 文档](https://beanie-odm.dev/)。\n\n## 🙏 感谢\n\n在此感谢以下开发者(项目)对本项目做出的贡献：\n\n- [nonebot-plugin-template](https://github.com/A-kirami/nonebot-plugin-template): 项目的 README 模板\n\n## ⏳ Star 趋势\n\n[![Stargazers over time](https://starchart.cc/Well2333/nonebot-plugin-mongodb.svg)](https://starchart.cc/Well2333/nonebot-plugin-mongodb)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwell2333%2Fnonebot-plugin-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwell2333%2Fnonebot-plugin-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwell2333%2Fnonebot-plugin-mongodb/lists"}