To remove specific lines from cypher return statement

Hello Team,

I am using simple cypher with return statement where i am trying to get the values back from label but i can see approx similar lines in output. I need to remove those lines marked in Bold.

Below is my cypher and its output:

CYPHER QUERY:

[root@JMNGD1BCD110V02 ~]# cat countlabel.cyp

match (n:AK) with count(n) as TotalCount return 'Total Count is : ' +TotalCount;

MATCH (z:check) with count(z) as TotalCount RETURN 'Total count in check label is : ' +TotalCount;

OUTPUT:

[root@JMNGD1BCD110V02 ~]# sh testingscript.sh

'Total Count is : ' +TotalCount

"Total Count is : 166000"

'Total count in check label is : ' +TotalCount

"Total count in check label is : 166198"

So i dont want the Bold lines in output but those lines should be part of cypher.

Any way to achieve this?

Best Regards
Akshat

Hi Akshat,

You are seeing the column names for the calculated fields in your return statement. Does the modification to your query below help you see what is going on? You could change Output1 and Output2 below to whatever column names you like.

match (n:AK) with count(n) as TotalCount return 'Total Count is : ' +TotalCount AS Output1;

MATCH (z:check) with count(z) as TotalCount RETURN 'Total count in check label is : ' +TotalCount AS Output2;

Best wishes,
Nathan

Hello Nathan,

It works absolutely fine for me.

Thanks a lot!!

Best Regards
Akshat

1 Like