Я пытаюсь извлечь имя столбца из результатов запроса Cyper Variable Length Relationships.Но не уверен, как получить имя столбца из сложного объекта.Ниже приведен код, который я пытался, но не смог добиться успеха.
или
Пожалуйста, посоветуйте, если хотите, откорректируйте запрос, чтобы получить указанное значение.
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 { …
}