Download the PHP package mryup/hyperf-mongodb without Composer
On this page you can find all versions of the php package mryup/hyperf-mongodb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download mryup/hyperf-mongodb
More information about mryup/hyperf-mongodb
Files in mryup/hyperf-mongodb
Download mryup/hyperf-mongodb
More information about mryup/hyperf-mongodb
Files in mryup/hyperf-mongodb
Vendor mryup
Package hyperf-mongodb
Short Description Open for hyperf mongodb, Fork of yumufeng/hyperf-mongodb,thanks Mr yumufeng
License MIT
Package hyperf-mongodb
Short Description Open for hyperf mongodb, Fork of yumufeng/hyperf-mongodb,thanks Mr yumufeng
License MIT
Please rate this library. Is it a good library?
Informations about the package hyperf-mongodb
hyperf mongodb pool
前言
Fork 与 包,添加了Query Builder,Model Eloquent,以及做了一些个性化修改 感谢大佬的开源奉献,如若侵权,烦请告知下架
config
在/config/autoload目录里面创建文件 mongodb.php 添加以下内容
使用案例
使用注解,自动加载 \Hyperf\Mongodb\MongoDb
tips:
查询的值,是严格区分类型,string、int类型的哦
新增
单个添加
批量添加
查询
分页查询
更新
删除
count统计
Eloquent
- 手动创建一个model,继承
Mryup\HyperfMongodb\MongodbModel
,(这里做了JWT鉴权,可忽略)
Eloquent Usage
Eloquent已经实现自增create(..),代码如下
- 维护其他所有集合的自增id的集合(systemIds)数据结构如下
Command,执行更复杂的mongo命令
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
nesbot/carbon Version ^2.0
psr/container Version ^1.0
hyperf/pool Version ^2.0
hyperf/utils Version ^2.0
nesbot/carbon Version ^2.0
The package mryup/hyperf-mongodb contains the following files
Loading the files please wait ....