Closed yiyi3681 closed 1 year ago
那你可以试试使用:
可以确定 p0 是 String
get subgraph 1 steps from '${ p0 }'
yield vertices as nodes, edges as relationships
或者:
p0 的类型不定
get subgraph 1 steps from ${ ng.valueFmt( p0 ) }
yield vertices as nodes, edges as relationships
@wey-gu get subgraph 是不是也不支持参数化
那你可以试试使用:
- 可以确定 p0 是 String
get subgraph 1 steps from '${ p0 }' yield vertices as nodes, edges as relationships
或者:
- p0 的类型不定
get subgraph 1 steps from ${ ng.valueFmt( p0 ) } yield vertices as nodes, edges as relationships
这种也不行 org.nebula.contrib.ngbatis.exception.QueryException: 数据查询失败: 数据查询失败SyntaxError: syntax error near ` $'
logging:
level:
org.nebula.contrib: DEBUG
可以在 yml 里追加上面这段配置,看看输出的的 nGQL 吗,
如果使用刚刚说的方式,$
会在参数替换的过程被替换掉,传不到数据库里,也就不存在下面这个报错了
org.nebula.contrib.ngbatis.exception.QueryException: 数据查询失败: 数据查询失败SyntaxError: syntax error near ` $'
那你可以试试使用:
- 可以确定 p0 是 String
get subgraph 1 steps from '${ p0 }' yield vertices as nodes, edges as relationships
或者:
- p0 的类型不定
get subgraph 1 steps from ${ ng.valueFmt( p0 ) } yield vertices as nodes, edges as relationships
第一种可以了,单引号换成双引号也可以,感谢~
想查询指定vid的subgraph,xml如下:
pojo层的Subgraph类跟demo一摸一样;
dao如下:
测试模块:
报错如下: org.nebula.contrib.ngbatis.exception.QueryException: 数据查询失败: 数据查询失败SyntaxError: Parameter is not supported in vid near ` $p'
将xml中的$p0替换成特定的vid可以正常查询,但是改为参数就不行了,麻烦帮忙看看谢谢啦