title: returning an object from collect (cypher/neo4j)
body: <p>I'm trying to return content in the language specified by the user, or the default language (english) if the content is not found in the selected language. It seems like returning an object from a collect statement is not supported. Is there a way to achieve a similar result though?</p>
  
  <p>The query as it is now:</p>
  
  <pre><code>MATCH (meta:contentMeta)&lt;-[metaLang:HAS_META]-(content:content)-[:TAGGED_WITH]-(termNode:term)-[lang:HAS_LANGUAGE]-(langNode:termMeta)
  WHERE 
      metaLang.languageCode = {language} 
      OR metaLang.languageCode = {defaultLanguage} 
      AND lang.languageCode = {language} 
      OR lang.languageCode = {defaultLanguage}
  RETURN DISTINCT collect(langNode.name) AS terms, 
      content.displayType AS displayType, 
      content.savedAs AS savedAs, 
      content.webURL AS webURL, 
      content.embedSrc AS embedsrc, 
      content.UUID AS UUID
  LIMIT 15
  </code></pre>
  
  <p>The problem is what I really want returned is an object with the name of the node as well as the language code. Something like:</p>
  
  <pre><code>collect(langNode.name, langNode.languageCode) AS terms
  </code></pre>
  
  <p>or this:</p>
  
  <pre><code>collect(langNode.name) AS terms.name, 
  collect(langNode.languageCode) AS terms.languageCode
  </code></pre>
  
  <p>Of course, this syntax does not work. Are there any simple solutions to this?</p>