# xiaoapi-mongodb
[xiaoapi](https://github.com/xiaojinlii/xiaoapi)的mongodb扩展包
## 安装
```
pip install xiaoapi-mongodb
```
## 配置
需要在 application/settings 中 添加以下配置:
```python
# MongoDB 数据库配置
# 格式:mongodb://用户名:密码@地址:端口/?authSource=数据库名称
MONGO_DB_ENABLE = False
MONGO_DB_NAME = "fastapi"
MONGO_DB_URL = f"mongodb://admin:123456@177.8.0.6:27017/?authSource={MONGO_DB_NAME}"
```
然后在 application/settings 中的 EVENTS 里引入 xiaoapi_mongodb
```python
EVENTS = [
"xiaoapi_mongodb.connect_mongo",
]
```
Raw data
{
"_id": null,
"home_page": null,
"name": "xiaoapi-mongodb",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "xiaoapi, fastapi, web-framework, mongodb",
"author": null,
"author_email": "xiaojinli <553555614@qq.com>",
"download_url": "https://files.pythonhosted.org/packages/09/a9/7eb940f9094de3b35a6487084f682fbac5e8b5f136097fd9736fea28773c/xiaoapi-mongodb-0.0.3.tar.gz",
"platform": null,
"description": "# xiaoapi-mongodb\r\n[xiaoapi](https://github.com/xiaojinlii/xiaoapi)\u7684mongodb\u6269\u5c55\u5305\r\n\r\n\r\n## \u5b89\u88c5\r\n```\r\npip install xiaoapi-mongodb\r\n```\r\n\r\n\r\n## \u914d\u7f6e\r\n\u9700\u8981\u5728 application/settings \u4e2d \u6dfb\u52a0\u4ee5\u4e0b\u914d\u7f6e\uff1a\r\n```python\r\n# MongoDB \u6570\u636e\u5e93\u914d\u7f6e\r\n# \u683c\u5f0f\uff1amongodb://\u7528\u6237\u540d:\u5bc6\u7801@\u5730\u5740:\u7aef\u53e3/?authSource=\u6570\u636e\u5e93\u540d\u79f0\r\nMONGO_DB_ENABLE = False\r\nMONGO_DB_NAME = \"fastapi\"\r\nMONGO_DB_URL = f\"mongodb://admin:123456@177.8.0.6:27017/?authSource={MONGO_DB_NAME}\"\r\n```\r\n\r\n\u7136\u540e\u5728 application/settings \u4e2d\u7684 EVENTS \u91cc\u5f15\u5165 xiaoapi_mongodb\r\n```python\r\nEVENTS = [\r\n \"xiaoapi_mongodb.connect_mongo\",\r\n]\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "xiaoapi mongodb",
"version": "0.0.3",
"project_urls": {
"Documentation": "https://github.com/xiaojinlii/xiaoapi/blob/main/libs/mongodb/README.md",
"Repository": "https://github.com/xiaojinlii/xiaoapi",
"Source Code": "https://github.com/xiaojinlii/xiaoapi/tree/main/libs/mongodb"
},
"split_keywords": [
"xiaoapi",
" fastapi",
" web-framework",
" mongodb"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2956d4843c37cde52f641b826a53a0d0acfd939def3ece3625e34705ef8029c1",
"md5": "36b83556971ab2c6c6b3255cf980d64d",
"sha256": "f91d3c17c9523ea6cc24076066f7d65bcd4d1981801541bbb09978f9815a9eed"
},
"downloads": -1,
"filename": "xiaoapi_mongodb-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "36b83556971ab2c6c6b3255cf980d64d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 6149,
"upload_time": "2024-03-29T01:54:12",
"upload_time_iso_8601": "2024-03-29T01:54:12.328151Z",
"url": "https://files.pythonhosted.org/packages/29/56/d4843c37cde52f641b826a53a0d0acfd939def3ece3625e34705ef8029c1/xiaoapi_mongodb-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "09a97eb940f9094de3b35a6487084f682fbac5e8b5f136097fd9736fea28773c",
"md5": "c04ecfedfdac50c1e9e07edc7f8c4c7b",
"sha256": "196b63764b0c67b34d279c692a24084ed8abbf72dd09d14f729685d187a32a1d"
},
"downloads": -1,
"filename": "xiaoapi-mongodb-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "c04ecfedfdac50c1e9e07edc7f8c4c7b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 6915,
"upload_time": "2024-03-29T01:54:14",
"upload_time_iso_8601": "2024-03-29T01:54:14.322880Z",
"url": "https://files.pythonhosted.org/packages/09/a9/7eb940f9094de3b35a6487084f682fbac5e8b5f136097fd9736fea28773c/xiaoapi-mongodb-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-29 01:54:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "xiaojinlii",
"github_project": "xiaoapi",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "fastapi",
"specs": [
[
"==",
"0.110.0"
]
]
},
{
"name": "uvicorn",
"specs": [
[
"==",
"0.25.0"
]
]
},
{
"name": "typer",
"specs": [
[
"==",
"0.10.0"
]
]
},
{
"name": "loguru",
"specs": [
[
"==",
"0.7.2"
]
]
},
{
"name": "orjson",
"specs": [
[
"==",
"3.9.15"
]
]
},
{
"name": "SQLAlchemy",
"specs": [
[
"==",
"2.0.25"
]
]
},
{
"name": "asyncmy",
"specs": [
[
"==",
"0.2.9"
]
]
},
{
"name": "aiosqlite",
"specs": [
[
"==",
"0.20.0"
]
]
}
],
"lcname": "xiaoapi-mongodb"
}