node.js - 如何从密码可变长度关系查询中提取值?
问题描述
我正在尝试从 cyper 可变长度关系查询结果中提取名称列。但不确定如何从复杂对象中获取名称列。下面是我正在尝试但无法成功的代码。
或者
请告知是否有任何方式调整查询以获得指定的值。
session.run('match path=(n)-[:DATA*..3]-(m) where n._nme=$source and
m._nme=$destination return path ',
{source:source,destination:destination}).then(function(result) {
result.records.forEach(function(record){
console.log(record._fields[0].properties.nme);
});
});
这是记录json
records: (215) […]
[0…99]
[100…199]
[200…214]
length: 215
<prototype>: Array []
summary: Object { statementType: "r", plan: false, profile: false, … }
<prototype>: Object { … }
这里扩展的json
records: (215) […]
[0…99]
0: {…}
_fieldLookup: Object { path: 0 }
_fields: (1) […]
0: {…}
end: Object { identity: "110", labels: (1) […], properties: {…} }
length: 3
segments: Array(3) [ {…}, {…}, {…} ]
start: Object { identity: "92", labels: (1) […], properties: {…} }
<prototype>: Object { … }
length: 1
<prototype>: Array []
keys: Array [ "path" ]
length: 1
<prototype>: Object { …
}
解决方案
推荐阅读
- html - 使用 Angular 复制带有 UI 和所选值的下拉列表
- php - WP下单后挂钩
- c# - StringContent 是否与 HttpResponseMessage 一起处理?
- python - 我的带有套接字的程序现在随机停止工作并给我 socket.timeout 吗?
- angular - 控制台中的mutationObserverCallback 登录,性能下降症状?
- reactjs - Graph QL 没有返回正确的数据
- c# - 合并源列表
和 SourceCache - azure-devops - 签出 Azure Devops 多阶段 yaml 文件中的特定文件夹
- python - 在 Python 中转换期间音频未与视频合并
- typescript - TypeScript 在 Map 中保留类