database - Gremlin:提供的遍历器未映射到值
问题描述
g.V()
.has('atom', '_value', 'red').fold()
.coalesce(unfold(), addV('atom').property('_value', 'red')).as('atom')
.out('view').has('view', '_name', 'color').fold()
.coalesce(unfold(), addE('view').from('atom').to(addV('view').property('_name', 'color')))
给我一个错误:
The provided traverser does not map to a value: []->[SelectOneStep(last,atom)] (597)
这是什么意思?
解决方案
所以看起来 whenas()
后面跟着fold()
它删除了as()
步骤中设置的变量。我aggregate()
改为使用如下:
g.V()
.has('atom', '_value', 'red')
.fold().coalesce(
unfold(),
addV('atom').property('_value', 'red')
)
.aggregate('atom')
.out('view').has('view', '_name', 'color')
.fold().coalesce(
unfold(),
addE('view')
.from(select('atom').unfold())
.to(addV('view').property('_name', 'color'))
.inV()
)
推荐阅读
- three.js - 如何在three.js中以特定距离向特定方向移动对象
- android - Android Flutter 分析音频波形
- python - 防病毒软件将 python.exe 检测为 idp.generic?
- java - 如何使用 java 更改谷歌驱动器文件的 mimetype
- c# - 使用 RESTful API,不管 SuccessStatusCode
- python - Python卡方拟合优度测试以获得最佳分布
- java - 第 21 行显示;预期的
- javascript - 在卸载或确认 onbeforeunload 时发送 SocketIO 消息
- php - 如何在PHP中的多维数组中合并数组
- java - Selenium WebDriver GetPageSource().Contains("")