Grouping CASE results in neo4j cypher -


i have linked list setup root node, links different item types. retrieve first 10 items (with possible relationships), doing following:

start user=node(1) match user-[:list*1..10]->item item match author-[a?:author]->item return item, a, author 

this works fine , returns desired items, there author properties don't want return client. return desired properties, eg. return author.name, author.location, won't work if item not have author. can use ? on properties, potentially end lot of null properties each item.

then found case statement, , works use case. problem able return multiple properties per then if possible. example:

return labels(item) type, case head(type)      when "post" (item.title, item.text, author)     when "message" (item.subject, item.content) end item 

the when lines above return syntax error because can put single value after then. there way combine results object way above?

use literal collection after then, add map support in future, nicer :)

you can change head(type) item:label

return labels(item) type, case      when item:post [item.title, item.text, author]     when item:mesage [item.subject, item.content] end item 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -