You can include all properties of the node by just using node:
MATCH (n)
RETURN { _data : n, _id : id(n), _labels : labels(n) }
Docs are here:
http://docs.neo4j.org/chunked/milestone/syntax-collections.html#_literal_maps
Michael
Am 21.02.2014 um 14:14 schrieb Bob B <[email protected]>:
> Hi,
>
> Michael Hunger uses some interesting cypher syntax to do some custom json
> response formatting in this stackoverflow answer. Can anyone point me at the
> documentation for this syntax? Also, if anyone knows how to include all the
> properties of a node (as requested in the comments here), then that would be
> awesome!
>
> Thanks,
> Bob
>
> Example shown here for immediate context. Notice how the objects are
> constructed...
>
> MATCH (a:USER)-[:owns]->(b:ALBUM)-[:CONTAINS]->(c:PHOTO)
> WITH a,b,{url: c.name} as c_photos
> WITH a,{album: b.name , photos: collect(c_photos)} as b_albums
> WITH {name: a.name, albums: collect(b_albums)} as a_users
> RETURN {users: collect(a_users)}
>
> --
> You received this message because you are subscribed to the Google Groups
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.