4
votes

I want to run all these queries into neo4j, I can successfully run one cypher query in session but for multiple queries, it shows error. I also need result back in JSON format for individual queries. Any help please?

var array=[];
var ftrend= [ '21', '23', '24', '41', '42', '43' ]
console.log("Query for TSB");

for (var j = 0; j<ftrend.length; j++){
    var b=0; var m=0; var t=0;

    for (var i = 0 ; i < 16; i++) {

        t= t+1;
        tbm_id = 'T'+t;
        array.push('MATCH (qck:QuickCheckKriterium {uuid:"' + tbm_id  + '"}),(tsb:Trendsteckbrief {id :"TSB'+ftrend[j]+'"}) return *')

    }


}

console.log(array);

//sample result for this query

MATCH (qck:QuickCheckKriterium {uuid:"T1"}),(tsb:Trendsteckbrief {id :"TSB21"}) return *',

'MATCH (qck:QuickCheckKriterium {uuid:"T2"}),(tsb:Trendsteckbrief {id :"TSB21"}) return *',

MATCH (qck:QuickCheckKriterium {uuid:"T1"}),(tsb:Trendsteckbrief {id :"TSB23"}) return *',

'MATCH (qck:QuickCheckKriterium {uuid:"T2"}),(tsb:Trendsteckbrief {id :"TSB23"}) return *'
1

1 Answers

0
votes