Database Reference
In-Depth Information
:HAS_SEEN[3] {stars->3},
Node[6]{name->"Heat",type->"Movie"}
] |
Note
In the previous example you returned both a node property and a path from the Cypher
query. All returnable graph entities discussed here can be specified in any desired combin-
ation.
When displaying data on a screen or printing on paper, you usually won't want to display
allresultsatonce,butrathersplitthemintopagesforbetterreadability andusability.Inthe
next section you'll learn how to page the results of a Cypher query.
Paging results
Ifyourresultsetcontainsalotofentries,youmayneedtopagetheresultsforrenderingon
a web page. To page Cypher query results, Neo4j has three self-explanatory clauses:
order —Orders the full result set before paging, so that paging returns consistent
results regardless of whether you're going forward or backward through the pages
skip —Offsets the result set so you can go to a specified page
limit —Limits the number of returned results to the page size
Supposeoneoftheusersinyourdatabaseisarealmoviebuff,whohasseenandratedhun-
dreds ofmovies. Ifyouwere to display all ofthat user'smovie ratings (stars awarded) ona
single page, the type would be unreadably small (or it wouldn't fit).
You could decide to display only 20 movies per web page, ordered by movie name. To
query the graph to get such paged results, you'd use the order , limit , and skip
clauses. The following query returns the third page (entries 21-30):
Search WWH ::




Custom Search