cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Getting result of query into a list format

Hello, I'm working on a database that has two types of nodes : jobs and skills . They have a 'USES' relationship.

I am able of getting all skills used in a certain job. However I would like to have the skill.name of all skills in a list in the response json using this:

MATCH (n:Technologies)<-[u:USES]-(j:Jobs) where j.name="skilname" return  n.name  order by n.trend ASC limit 25

Basically, this is what I'm getting:

[
  {
    "keys": [
      "n.name"
    ],
    "length": 1,
    "_fields": [
      "TKProf"
    ],
    "_fieldLookup": {
      "n.name": 0
    }
  },
  {
    "keys": [
      "n.name"
    ],
    "length": 1,
    "_fields": [
      "SmarTeam"
    ],
    "_fieldLookup": {
      "n.name": 0
    }

But I would like to get this:

[ {keys:["n. name"],
values: [skill1.name,skill2.name,skill3.name.....]
}
]

Any tip is well appreciated, thank you.

1 ACCEPTED SOLUTION

You might consider trying COLLECT...something like RETURN COLLECT(n.name) AS nameList?

View solution in original post

2 REPLIES 2

You might consider trying COLLECT...something like RETURN COLLECT(n.name) AS nameList?

Thank you! I ended up using with COLLECT(n.name) as namelist return namelist .