db.cypher({
query: 'MATCH (fi:FormDefinitionImageIndex {id: ' + row.formDefinitionImageIndexFieldID + '}),' +
'(d:FormDefinitionImage {id: ' + row.formDefinitionImageID + '})' +
' MERGE (fi)-[:IMAGEINDEX]->(d) '
},
function (err, result) {
if (err) {
return reject(err);
} else {
return resolve(result);
}
});
}).then(function (results) {
if(results.length == 0) {
console.log('No FormDefinitionImageIndexField relationships for (' + row.formDefinitionImageIndexFieldID + ' <-> ' + row.formDefinitionImageID + ') index field key ' + row.indexFieldKey);
} else {
console.log('FormDefinitionImageIndexField relationship ' + results.length);
}
return results;
});
As can be seen from the code I would expect an array of results when the promise is "resolved". But instead I am getting a single zero lengthed array. The cypher query forms the relationship but it is odd that the return value is empty. Ideas?
Thank you.
Kevin