Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You could define your external ID as extra property on your nodes. Then depending on if your are using SpringData or not, you can insert the data.</p> <p>If you are using SpringData, you can configure your external ID as unique index and then normally save you nodes(consider though, that inserting a duplicated ID will overwrite the existing one).</p> <p>If you are using the plain java API, you can create unique nodes as described here: <a href="http://docs.neo4j.org/chunked/stable/tutorials-java-embedded-unique-nodes.html#tutorials-java-embedded-unique-get-or-create" rel="nofollow">http://docs.neo4j.org/chunked/stable/tutorials-java-embedded-unique-nodes.html#tutorials-java-embedded-unique-get-or-create</a></p> <p>EDIT: As for a sample query, does this help you? <a href="http://console.neo4j.org/?id=b0z486" rel="nofollow">http://console.neo4j.org/?id=b0z486</a></p> <p>With the java api you would do it like this</p> <pre><code>firstNode = graphDb.createNode(); firstNode.setProperty( "externalID", "1" ); firstNode.setProperty( "name", "foo" ); secondNode = graphDb.createNode(); secondNode.setProperty( "externalID", "2" ); secondNode.setProperty( "name", "bar" ); relationship = firstNode.createRelationshipTo( secondNode, RelTypes.Likes ); </code></pre> <p>I suggest you read some tutorials here: <a href="http://docs.neo4j.org/chunked/stable/tutorials-java-embedded-hello-world.html" rel="nofollow">http://docs.neo4j.org/chunked/stable/tutorials-java-embedded-hello-world.html</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload