Commit 539aa09e authored by Anders Nawroth's avatar Anders Nawroth
Browse files

Documentation fixes for 2.1.

* Added UNWIND to refcard.
* Better links to other resources.
* Typos.
* Added refcard the docs build.
parent 4b9b5174
No related merge requests found
Showing with 35 additions and 20 deletions
+35 -20
......@@ -41,13 +41,14 @@ class CollectionsTest extends RefcardTest with QueryStatisticsTestSupport {
}
}
override def parameters(name: String): Map[String, Any] =
name match {
case "parameters=name" =>
Map("value" -> "Bob")
case "parameters=names" =>
Map("names" -> List("A", "B"))
case "parameters=coll" =>
Map("coll" -> List(1,2,3))
Map("coll" -> List(1, 2, 3))
case "parameters=range" =>
Map("first_num" -> 1, "last_num" -> 10, "step" -> 2)
case "parameters=subscript" =>
......@@ -57,8 +58,8 @@ class CollectionsTest extends RefcardTest with QueryStatisticsTestSupport {
}
override val properties: Map[String, Map[String, Any]] = Map(
"A" -> Map("name" -> "Alice","coll"->Array(1,2,3)),
"B" -> Map("name" -> "Bob","coll"->Array(1,2,3)))
"A" -> Map("name" -> "Alice", "coll" -> Array(1, 2, 3), "age" -> 30),
"B" -> Map("name" -> "Bob", "coll" -> Array(1, 2, 3), "age" -> 40))
def text = """
###assertion=returns-one
......@@ -122,5 +123,17 @@ Collection elements can be accessed with +idx+ subscripts in square brackets.
Invalid indexes return +NULL+.
Slices can be retrieved with intervals from +start_idx+ to +end_idx+ each of which can be omitted or negative.
Out of range elements are ignored.
###assertion=returns-one parameters=names
//
UNWIND {names} AS name
MATCH (n {name:name})
RETURN avg(n.age)
###
With +UNWIND+, you can transform any collection back into individual rows.
The example matches all names from a list of names.
"""
}
......@@ -16,7 +16,7 @@ include::create-a-node.asciidoc[]
include::create-a-node-with-multiple-properties.asciidoc[]
include::create-mutiple-nodes-with-properties.asciidoc[]
include::create-multiple-nodes-with-properties.asciidoc[]
include::set-all-properties-on-a-node-using-cypher.asciidoc[]
......
......@@ -225,7 +225,7 @@ public class CypherDocIT extends AbstractRestFunctionalTestBase {
*/
@Test
@Documented
@Title( "Create mutiple nodes with properties" )
@Title( "Create multiple nodes with properties" )
@Graph
public void send_query_to_create_multipe_nodes_from_a_map() throws Exception
{
......@@ -411,4 +411,4 @@ public class CypherDocIT extends AbstractRestFunctionalTestBase {
{
return getDataUri() + "cypher";
}
}
\ No newline at end of file
}
......@@ -24,15 +24,15 @@ ifdef::backend-html5,backend-deckjs[]
<script src="js/modernizr.custom.2.6.2.js"></script>
<link href="css/cypher_main.css" rel="stylesheet" media="print, screen" type="text/css">
<!-- favicon -->
<link rel="shortcut icon" href="http://neo4j.org/favicon.ico" type="image/vnd.microsoft.icon" />
<link rel="icon" href="http://neo4j.org/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/vnd.microsoft.icon" />
<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
<!-- Syntax Highlighter -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.min.css">
<link rel="stylesheet" href="http://gist.neo4j.org/css/codemirror-neo.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/addon/runmode/runmode.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/mode/javascript/javascript.min.js"></script>
<script src="http://gist.neo4j.org/js/codemirror-cypher.js"></script>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/codemirror/4.2.0/codemirror.css" />
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/codemirror/4.2.0/theme/neo.css" />
<script src="http://cdnjs.cloudflare.com/ajax/libs/codemirror/4.2.0/codemirror.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/codemirror/4.2.0/addon/runmode/runmode.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/codemirror/4.2.0/mode/javascript/javascript.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/codemirror/4.2.0/mode/cypher/cypher.js"></script>
<script src="js/colorize.js"></script>
{docinfo1,docinfo2#}{include:{docdir}/docinfo.html}
{docinfo,docinfo2#}{include:{docdir}/{docname}-docinfo.html}
......
manual/refcard/src/images/favicon.ico

4.19 KB

......@@ -159,7 +159,7 @@ A node may be labeled with any number of labels, including none, making labels a
"A Label" -> "Node" [label="groups"]
----
Labels are used when defining contraints and adding indexes for properties.
Labels are used when defining constraints and adding indexes for properties.
An example would be a label named +User+ that you label all your nodes representing users with.
With that in place, you can ask Neo4j to perform operations only on your user nodes, such as finding all users with a given name.
......@@ -170,7 +170,7 @@ You might create an +Offline+ label for phones that are offline, a +Happy+ label
=== Label names ===
Any non-empty unicode string can be used as a label name.
Any non-empty Unicode string can be used as a label name.
In Cypher, you may need to use the backtick (++`++) syntax to avoid clashes with Cypher identifier rules.
By convention, labels are written with CamelCase notation, with the first letter in upper case.
For instance, +User+ or +CarOwner+.
......
......@@ -31,9 +31,10 @@ Thus, the examples are always in sync with how Neo4j actually works.
There's other documentation resources besides the manual as well:
* Neo4j Cypher Refcard, see http://docs.neo4j.org/ for available versions.
* Neo4j GraphGist, an online tool for creating interactive web pages with executable Cypher statements: http://gist.neo4j.org/.
* The main Neo4j site at http://www.neo4j.org/ is a good starting point to learn about Neo4j.
* Neo4j Cypher Refcard, see http://docs.neo4j.org/refcard/{neo4j-version}.
* Neo4j GraphGist, an online tool for creating interactive documents with executable Cypher statements: http://gist.neo4j.org/.
* The main Neo4j site at http://neo4j.com/ is a good starting point to learn about Neo4j.
* For use when writing Neo4j extensions and plugins, or for embedded usage, see link:javadocs/[Neo4j Javadocs].
_Who should read this?_
......
......@@ -321,6 +321,7 @@ public class ComponentVersion extends Version
</activation>
<modules>
<module>manual</module>
<module>manual/refcard</module>
</modules>
<properties>
<attach-java-sources-phase>package</attach-java-sources-phase>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment