您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

分享一个neo4j(图形数据库)的PHP库!

2024/2/24 18:13:11发布24次查看
git 项目地址 church/neo4j:https://github.com/fireqong/neo4j
介绍
基于php的neo4j库,可以帮助你更加便捷的连接neo4j的php库,源文档链接地址 neo4j http api:https://neo4j.com/docs/http-api/current/actions/
安装环境需求
php >= 7.4
安装
composer require church/neo4j
用法
初始化
$app = new \church\neo4j\application("http://127.0.0.1:7474", "neo4j", "neo4j");$app->discovery();
查询语句
$statement = (new \church\neo4j\statement('create (n $props) return n)'))->params([ 'props' => [ 'name' => 'test' ] ]);
开启事务
$statements = \church\neo4j\statementrepository::add($statement);$transaction = $app->transaction($statements);$transaction->begin();
提交事务
$result = $transaction->commit();if ($result->getrawresponse()->getstatuscode() == 200) { print_r($result->getdata());}
延长事务有效期
default expiry time is 60 seconds.$transaction->keepalive();
回滚
$transaction->rollback();
开启和提交事务
$result = $transaction->beginandcommit();print_r($result);
单元测试
composer install./vendor/bin/phpunit
以上就是分享一个neo4j(图形数据库)的php库!的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product