Download the PHP package adamchen1208/hyperf-mongodb without Composer
On this page you can find all versions of the php package adamchen1208/hyperf-mongodb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package hyperf-mongodb
hyperf-mongodb
介绍
用于hyperf的mongodb连接池组件,暂不支持协程。基于composer项目yumufeng/hyperf-mongodb和项目mongodb/mongodb做了个性化的优化。
hyperf mongodb pool
config
在/config/autoload目录里面创建文件 mongodb.php 添加以下内容
使用案例
使用注解,自动加载 \Hyperf\Mongodb\Mongodb
tips:
查询的值,是严格区分类型,string、int类型的哦
查询一条数据
查询全部数据
分页查询
查询一条数据(_id自动转对象)
查询全部数据(_id自动转对象)
分页查询(_id自动转对象)
插入一条数据
插入批量数据
更新
更新(_id自动转对象)
删除
批量删除
删除(_id自动转对象)
统计
聚合查询
sql 和 mongodb 关系对比图
| SQL | MongoDb |
|---|---|
| WHERE | $match (match里面可以用and,or,以及逻辑判断,但是好像不能用where) |
| GROUP BY | $group |
| HAVING | $match |
| SELECT | $project |
| ORDER BY | $sort |
| LIMIT | $limit |
| SUM() | $sum |
| COUNT() | $sum |
All versions of hyperf-mongodb with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.2
psr/container Version ^1.0
hyperf/pool Version ^2.0
hyperf/utils Version ~2.0.0
psr/container Version ^1.0
hyperf/pool Version ^2.0
hyperf/utils Version ~2.0.0
The package adamchen1208/hyperf-mongodb contains the following files
Loading the files please wait ...