[[rest-api-nested-results]]
=== Nested results ===

When sending queries that
return nested results like list and maps,
these will get serialized into nested JSON representations
according to their types.


[source,cypher]
----
START n = node(%I%,%you%)
RETURN collect(n.name)
----


.Final Graph
["dot", "Final-Graph-nested-results.svg", "neoviz"]
----
  N38 [
    label = "{Node\[38\]|name = \'you\'\l}"
  ]
  N39 [
    label = "{Node\[39\]|name = \'I\'\l}"
  ]
  N39 -> N38 [
    color = "#2e3436"
    fontcolor = "#2e3436"
    label = "know\n"
  ]
----

_Example request_

* *+POST+*  +http://localhost:7474/db/data/cypher+
* *+Accept:+* +application/json+
* *+Content-Type:+* +application/json+
[source,javascript]
----
{"query": "start n = node(39,38) return collect(n.name)","params": {}},
----


_Example response_

* *+200:+* +OK+
* *+Content-Type:+* +application/json+
[source,javascript]
----
{
  "columns" : [ "collect(n.name)" ],
  "data" : [ [ [ "I", "you" ] ] ]
}
----


