当前位置:网站首页>PHP库neo4j怎么安装及使用
PHP库neo4j怎么安装及使用
2022-07-28 20:51:00 【亿速云】
PHP库neo4j怎么安装及使用
这篇文章主要介绍了PHP库neo4j怎么安装及使用的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇PHP库neo4j怎么安装及使用文章都会有所收获,下面我们一起来看看吧。
介绍
基于PHP的neo4j库,可以帮助你更加便捷的连接neo4j的PHP库
安装环境需求
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
关于“PHP库neo4j怎么安装及使用”这篇文章的内容就介绍到这里,感谢各位的阅读!相信大家对“PHP库neo4j怎么安装及使用”知识都有一定的了解,大家如果还想学习更多知识,欢迎关注亿速云行业资讯频道。
边栏推荐
- Less than a year after its establishment! MIT derivative quantum computing company completed financing of US $9million
- imx6q gpio复用
- vuejs中如何实现动态路由切换及路由的缓存
- 删除容器镜像报错解决image is referenced in multiple repositories
- Ngx+sql environment offline installation log (RPM installation)
- MySQL built-in functions
- Soft exam network engineer
- ssh免密登陆
- tutorial/detailed_workflow.ipynb 量化金融Qlib库
- MySQL command (add, delete, check and modify)
猜你喜欢

软考网络工程师

SQL注入 Less34(POST型宽字节注入+布尔盲注)

示波器发展史中的变化

LCR测试仪最为主要的功能和用途都是什么
Integrating database Ecology: using eventbridge to build CDC applications

Less than a year after its establishment! MIT derivative quantum computing company completed financing of US $9million

When can I sign up for the 2022 class I constructor examination?

MySQL built-in functions

Static details of static members
How do we do full link grayscale on the database?
随机推荐
[Ruiji takeout] day05 package management business development
vuejs中如何实现动态路由切换及路由的缓存
ngx+sql环境离线安装日志(rpm安装)
Mysql8.0 cannot authorize users or prompt you are not allowed to create a user with grant
Use REM to make the font size adaptive to the screen
96. Different binary search trees (medium binary search tree dynamic planning)
MySQL command (add, delete, check and modify)
[CS231N]Lecture_ 2:Image Classification pipelin
2022年一级建造师考试什么时候才能报名?
What does GPRS network mean
Ngx+sql environment offline installation log (RPM installation)
使用PCL批量将点云.bin文件转.pcd
ECMASript 5/6 笔记
imx6q gpio复用
[Ruiji takeout project] Day5 - Chapter 6 mobile verification code login
Baidu map usage
职场pua但有道理
79. Word search (medium string array matrix backtracking)
Lotus 1.16.0 extend sector expiration time
JMeter installs third-party plug-ins plugins Manager