GitHub user wgmayer0 edited a comment on the discussion: Simplify this query 
and remove redundancy

```
SELECT jsonb_object_agg(k, v) AS result
FROM cypher('hermech', $$
  MATCH (a:contact_name)
  WHERE id(a) = 10133099161583644
  OPTIONAL MATCH (a)-[:DIRECT_EMAIL_ADDRESS]->(b:direct_email_address)
  OPTIONAL MATCH (a)<-[:CONTACT_NAME]-(c:account_name)
  OPTIONAL MATCH (c)-[:MAIN_PHONE_NUMBER]->(d:main_phone_number)
  OPTIONAL MATCH (c)-[:MAIN_STREET_ADDRESS]->(e:main_street_address)
  OPTIONAL MATCH (c)-[:MAIN_DOMAIN]->(f:main_domain)
  
  WITH [n IN [a,b,c,d,e,f] WHERE n IS NOT NULL] AS nodes
  UNWIND nodes AS n
  RETURN head(labels(n)) AS k, n.value AS v
$$) AS (k text, v text);
```
How about getting something like this? This doesn't work but is it possible to 
get something close?

GitHub link: 
https://github.com/apache/age/discussions/2226#discussioncomment-14568545

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to