
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
nonebot-plugin-mongodb
Advanced tools
如果你不是插件开发者,那么此插件一般不需要额外安装和加载
pip install nonebot-plugin-mongodb
pdm add nonebot-plugin-mongodb
poetry add nonebot-plugin-mongodb
conda install nonebot-plugin-mongodb
在你的插件中添加对应的 require 以确保此插件在被引用前正确加载
from nonebot import require
require("nonebot_plugin_mongodb")
在 nonebot2 项目的.env文件中添加下表中的配置, 配置均为非必须项
| 配置项 | 必填 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| mongo_uri | ⭕ | str | None | MongoDB 的连接 uri |
| mongo_database_name | ❌ | str | nonebot2 | 连接的数据库名 |
如果你不是插件开发者,那么此部分无需阅读
参考 exmple 中的示例代码
在 nonebot 的 startup 阶段时,本插件会读取 beanie.Document 的全部子类并加载,因此开发者无需额外进行 init_beanie 即可直接使用,关于具体的操作方法可以参考 beanie 文档。
在此感谢以下开发者(项目)对本项目做出的贡献:
FAQs
基于 MongoDB ODM 的数据库管理插件
We found that nonebot-plugin-mongodb demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.