Neo4j parameter
Neo4j browser:
$ :help param
Set a parameter
Set a parameter to be sent with queries.
The :param name => 'Stella' command will define a parameter named "name" and it will be sent along with your queries.
Using parameters, rather than hard coding values, will allow for reuse of the query plan cache
The right hand side of => is sent to the server and evaluated as Cypher with an implicit RETURN in front. This gives better type safety since some types (especially numbers) in JavaScript are hard to match with Neo4j:s type system.
To set a param as an integer, do :param x => 1 and to set it as a float, do :param x => 1.0.
Cypher query example with a param: MATCH (n:Person) WHERE n.name = $name.
$ :help params
Parameters
View and set parameters to be sent with queries.
The :params command will show you a list of all your current parameters.
Note that setting parameters using this method does not provide type safety with numbers.
Instead we advise you to set each param one by one using the :param x => 1 syntax.
See :help param for more info.
The :params {name: 'Stella', age: 24} command will replace your current parameters with the new parameters defined in the object.
转载:
作者:wry2008wry
来源:CSDN
原文:https://blog.csdn.net/wry2008wry/article/details/82984473
版权声明:本文为博主原创文章,转载请附上博文链接!
neo4j browser中定义参数变量
概念
在neo4j browser网页中调试cypher语句时,使用预先定义的变量会更方便且增加代码的可读性,类似于SQL语句中的参数。
参数对当前会话有效,网页刷新变量消失。变量为一个kv的键值对。
定义的语法是
:param a:1, b:2
或
:param {a: 1, b: 2}
如上,定义方式为一个冒号+param+空格+参数,注意有一个空格。有两种方式定义变量 :叠加的方式、整体的方式。
叠加方式
即将多个变量列出来,以追加的方式,如果变量的key已经存在则替换已有的,否则新建,如:
:param a:1, b:2
整体方式
整体更新定义变量的键值对,以前所有的变量被覆盖:
:param {a: 1, b: 2}
显示所有变量
在命令框中输入
:params
使用变量
先定义一个列表类型的变量
:param items:[1, 2, 3]
使用变量:
UNWIND $items as item
return item
注意使用变量的时候在变量名前中一个$,和phpe及shell类似
---------------------
Neo4j parameter的更多相关文章
- Projected coordinate systems 和 wkid
Projected coordinate systems Well-known ID Name Well-known text 2000 Anguilla_1957_British_West_Indi ...
- Neo4j 第五篇:批量更新数据
相比图形数据的查询,Neo4j更新图形数据的速度较慢,通常情况下,Neo4j更新数据的工作流程是:每次数据更新都会执行一次数据库连接,打开一个事务,在事务中更新数据.当数据量非常大时,这种做法非常耗时 ...
- neo4j 数据库导入导出
工作中需要将 A 图数据库的数据完全导出,并插入到 B 图数据库中.查找资料,好多都是通过导入,导出 CSV 文件来实现.然而,经过仔细研究发现,导出的节点/关系 都带有 id 属性 ,因为 A B ...
- Neo4j社区版配置文件
#*****************************************************************# Neo4j configuration## For more d ...
- Neo4j使用简单例子(转)
Neo4j Versions Most of the examples on this page are written with Neo4j 2.0 in mind, so they skip th ...
- Neo4j数据进行备份、还原
一.neo4j备份方式 neo4j数据库的备份还原分为两种: offline 和 online. Offline backup - dump Dump a database into a single ...
- Neo4j使用简单例子
Neo4j Versions Most of the examples on this page are written with Neo4j 2.0 in mind, so they skip th ...
- 参数探测(Parameter Sniffing)影响存储过程执行效率解决方案
如果SQL query中有参数,SQL Server 会创建一个参数嗅探进程以提高执行性能.该计划通常是最好的并被保存以重复利用.只是偶尔,不会选择最优的执行计划而影响执行效率. SQL Server ...
- 图形数据库Neo4J简介
最近我在用图形数据库来完成对一个初创项目的支持.在使用过程中觉得这种图形数据库实际上挺有意思的.因此在这里给大家做一个简单的介绍. NoSQL数据库相信大家都听说过.它们常常可以用来处理传统的关系型数 ...
随机推荐
- 银行贷款(dp)
链接:https://www.nowcoder.com/acm/contest/79/A来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536KS ...
- int类型转换舍入问题
一,看代码 using System; using System.Collections.Generic; using System.Linq; using System.Text; using Sy ...
- Dagger2 探索记2——四大基本组件(二)
书接上文,先回顾以下前一章写的内容. 内容大概就是在Activity中用@Inject标记一个注入的类,然后在这个类的构造函数上也打个@Inject标记,然后使用@Component来连接两边,完成对 ...
- Linux学习笔记0-CentOS7关闭防火墙
关闭防火墙 systemctl stop firewalld.service //停止firewall systemctl disable firewalld.service //禁止firewall ...
- 【转载】linux查看端口状态相关命令
具体命令移步:https://www.cnblogs.com/cxbhakim/p/9353383.html
- Ubuntu中实现Docker内安装jenkins+jenkins远程触发
前面做了在ubuntu中安装jenkins+docker实现自动部署,但是得安装jdk8+tomcat8环境,比较麻烦,因此本文记录如何将jenkins直接装在dockers内并且实现远程触发功能. ...
- 一、bootstrap-datepicker
一.bootstrap-datepicker <!DOCTYPE html> <html> <head> <title></title> & ...
- Django Rest框架 APIView源码调用
上一篇说了请求访问的流程,这一篇说一下请求对应的源码调用 as_view 定义view dispatch dispatch initialize_request get_parsers ...
- WebDriverAgent安装
这次安装WebDriverAgent的过程可谓坎坷呀,最后还是大牛远程解决问题,自己的确差太远,记录一下过程吧 尽量升级Xcode到最新版,保持iPhone的版本大于9.3 终端进入目标文件夹WebD ...
- Jquery对象转js对象
$(this) Jquery对象 var sex=$(this).get(0); js对象 sex.style.display='block';