title: How to access properties of nested query with neo4j apoc.convert.toTree()?
body: <p>I am using apoc.convert.toTree  query</p>
  <pre><code>MATCH path = (e:Elections)&lt;-[OF_ELECTION]-(r:Race)&lt;-[c:ISA_CANDIDATE]- 
  </code></pre>
  <p>(m:Member)  WITH collect(path) as paths
  CALL apoc.convert.toTree(paths) yield value
  RETURN  value</p>
  <p>to return a nested array like this:</p>
  <pre><code>{
    &quot;election_date&quot;: &quot;2022-06-01&quot;,
    &quot;campaign_end&quot;: &quot;2022-05-20&quot;,
    &quot;certify_authorization&quot;: [
      &quot;General Secretary&quot;
    ],
    &quot;election_start_time&quot;: &quot;00:00:00-04:00&quot;,
    &quot;nomination_end&quot;: &quot;2022-05-17&quot;,
    &quot;_type&quot;: &quot;Elections&quot;,
    &quot;of_election&quot;: [
      {
        &quot;race_id&quot;: &quot;d9f7164b-c7b5-4ce5-a100-989e99100912&quot;,
        &quot;_type&quot;: &quot;Race&quot;,
        &quot;name&quot;: &quot;Chairperson&quot;,
        &quot;rank&quot;: 1,
        &quot;_id&quot;: 18,
        &quot;isa_candidate&quot;: [
          {
            &quot;member_id&quot;: &quot;397a2303-5030-4686-8bf6-25adc7fde33b&quot;,
            &quot;role&quot;: &quot;admin&quot;,
            &quot;isa_candidate.createdAt&quot;: &quot;2022-06-28&quot;,
            &quot;created&quot;: &quot;2022-06-12&quot;,
            &quot;_type&quot;: &quot;Member&quot;,
            &quot;last_name&quot;: &quot;Meek&quot;,
            &quot;telephone&quot;: &quot;8763719683&quot;,
            &quot;middle_name&quot;: &quot;X&quot;,
            &quot;trn&quot;: &quot;108859525&quot;,
            &quot;assocition&quot;: &quot;Hill Top Primary&quot;,
            &quot;isa_candidate.url&quot;: &quot;/assets/manifestos/397a2303-5030-4686-8bf6-25adc7fde33b-d9f7164b-c7b5-4ce5-a100-989e99100912.pdf&quot;,
            &quot;isa_candidate.certified&quot;: true,
            &quot;member_status&quot;: &quot;full&quot;,
            &quot;how_paid&quot;: &quot;MOE&quot;,
            &quot;paid_up&quot;: true,
            &quot;_id&quot;: 1147,
            &quot;category&quot;: &quot;full&quot;,
            &quot;isa_candidate.manifesto_summary&quot;: &quot;This is my Summary...&quot;,
            &quot;first_name&quot;: &quot;Devon&quot;,
            &quot;email&quot;: &quot;meekyd2015@yahoo.com&quot;,
            &quot;status&quot;: &quot;active&quot;
          },
          {
            &quot;member_id&quot;: &quot;7c2d7d7b-4a8f-4bff-854d-c09afe78f535&quot;,
            &quot;role&quot;: &quot;admin&quot;,
            &quot;isa_candidate.createdAt&quot;: &quot;2022-06-28&quot;,
            &quot;created&quot;: &quot;2022-06-12&quot;,
            &quot;_type&quot;: &quot;Member&quot;,
            &quot;last_name&quot;: &quot;Meeks-Ellis&quot;,
            &quot;telephone&quot;: &quot;8764543719&quot;,
            &quot;middle_name&quot;: &quot;Lorraine&quot;,
            &quot;trn&quot;: &quot;101472161&quot;,
            &quot;assocition&quot;: &quot;Hill Top Primary&quot;,
            &quot;isa_candidate.url&quot;: &quot;/assets/manifestos/7c2d7d7b-4a8f-4bff-854d-c09afe78f535-d9f7164b-c7b5-4ce5-a100-989e99100912.pdf&quot;,
            &quot;isa_candidate.certified&quot;: true,
            &quot;member_status&quot;: &quot;full&quot;,
            &quot;how_paid&quot;: &quot;MOE&quot;,
            &quot;paid_up&quot;: true,
            &quot;_id&quot;: 1152,
            &quot;category&quot;: &quot;full&quot;,
            &quot;isa_candidate.manifesto_summary&quot;: &quot;This is my Summary...&quot;,
            &quot;first_name&quot;: &quot;Faithilyn&quot;,
            &quot;email&quot;: &quot;faithilyn.meeksellis@jta.org.jm&quot;,
            &quot;status&quot;: &quot;active&quot;
          }
        ]
      },
      {
        &quot;race_id&quot;: &quot;256c2ac2-114f-4e7d-bd3c-e62fe4bbaa4f&quot;,
        &quot;_type&quot;: &quot;Race&quot;,
        &quot;name&quot;: &quot;Vice Chairperson&quot;,
        &quot;rank&quot;: 2,
        &quot;_id&quot;: 19,
        &quot;isa_candidate&quot;: [
          {
            &quot;member_id&quot;: &quot;f584d4a3-1c7d-456f-a798-f6f399a3fa2b&quot;,
            &quot;role&quot;: &quot;admin&quot;,
            &quot;isa_candidate.createdAt&quot;: &quot;2022-06-28&quot;,
            &quot;created&quot;: &quot;2022-06-12&quot;,
            &quot;_type&quot;: &quot;Member&quot;,
            &quot;last_name&quot;: &quot;Hendricks-White&quot;,
            &quot;telephone&quot;: &quot;8765999644&quot;,
            &quot;middle_name&quot;: &quot;Karon Marie&quot;,
            &quot;trn&quot;: &quot;105264733&quot;,
            &quot;assocition&quot;: &quot;Hill Top Primary&quot;,
            &quot;isa_candidate.url&quot;: &quot;/assets/manifestos/f584d4a3-1c7d-456f-a798-f6f399a3fa2b-256c2ac2-114f-4e7d-bd3c-e62fe4bbaa4f.pdf&quot;,
            &quot;isa_candidate.certified&quot;: true,
            &quot;member_status&quot;: &quot;full&quot;,
            &quot;how_paid&quot;: &quot;MOE&quot;,
            &quot;paid_up&quot;: true,
            &quot;_id&quot;: 1136,
            &quot;category&quot;: &quot;full&quot;,
            &quot;isa_candidate.manifesto_summary&quot;: &quot;This is my Summary...&quot;,
            &quot;first_name&quot;: &quot;Jacqueline&quot;,
            &quot;email&quot;: &quot;jacquelinehendricks4@gmail.com&quot;,
            &quot;status&quot;: &quot;active&quot;
          },
          {
            &quot;member_id&quot;: &quot;20473b78-3344-4d7a-885c-888e70a2585c&quot;,
            &quot;role&quot;: &quot;admin&quot;,
            &quot;isa_candidate.createdAt&quot;: &quot;2022-06-28&quot;,
            &quot;created&quot;: &quot;2022-06-12&quot;,
            &quot;_type&quot;: &quot;Member&quot;,
            &quot;last_name&quot;: &quot;Nash&quot;,
            &quot;telephone&quot;: &quot;8768748162&quot;,
            &quot;middle_name&quot;: &quot;R&quot;,
            &quot;trn&quot;: &quot;104804351&quot;,
            &quot;assocition&quot;: &quot;Hill Top Primary&quot;,
            &quot;isa_candidate.url&quot;: &quot;/assets/manifestos/20473b78-3344-4d7a-885c-888e70a2585c-256c2ac2-114f-4e7d-bd3c-e62fe4bbaa4f.pdf&quot;,
            &quot;isa_candidate.certified&quot;: true,
            &quot;member_status&quot;: &quot;full&quot;,
            &quot;how_paid&quot;: &quot;Bursar Paid&quot;,
            &quot;paid_up&quot;: true,
            &quot;_id&quot;: 1150,
            &quot;category&quot;: &quot;full&quot;,
            &quot;isa_candidate.manifesto_summary&quot;: &quot;This is my Summary...&quot;,
            &quot;first_name&quot;: &quot;Leaon&quot;,
            &quot;email&quot;: &quot;Jtapr2236@gmail.com&quot;,
            &quot;status&quot;: &quot;active&quot;
          }
        ]
      }
    ],
    &quot;content&quot;: &quot;This is a special election....&quot;,
    &quot;nomination_start&quot;: &quot;2022-05-15&quot;,
    &quot;election_stop_time&quot;: &quot;17:15:00-04:00&quot;,
    &quot;races&quot;: [
      &quot;Chairperson&quot;,
      &quot;Vice Chairperson&quot;
    ],
    &quot;election_end_date&quot;: &quot;2022-06-10T00:15:00[America/New_York]&quot;,
    &quot;name&quot;: &quot;JTA Parish Executive 2022&quot;,
    &quot;election_id&quot;: &quot;2be432d6-1e72-490c-9318-f75d7d3b68c3&quot;,
    &quot;audit_authorization&quot;: [
      &quot;General Secretary&quot;
    ],
    &quot;_id&quot;: 17,
    &quot;elegibility&quot;: &quot;full,retired&quot;,
    &quot;nominate_authorization&quot;: [
      &quot;General Secretary&quot;
    ],
    &quot;campaign_start&quot;: &quot;2022-05-30&quot;,
    &quot;election_start_date&quot;: &quot;2022-05-10T00:15:00[America/New_York]&quot;,
    &quot;tally_authorization&quot;: [
      &quot;General Secretary&quot;
    ]
  }
  </code></pre>
  <p>I need to access the properties of the nested arrays 'of_election' and 'isa_candidate'.  I can do</p>
  <pre><code>RETURN value.of_election
  </code></pre>
  <p>but I can't get access to none of its properties. So</p>
  <pre><code>RETURN value.of_election.name
  </code></pre>
  <p>violates all sorts of list/map rules.</p>
  <p>How can I access the properties of the nested arrays?</p>