Description Usage Arguments Details See Also Examples
Add an index to a node label and property key.
1 | addIndex(graph, label, key)
|
graph |
A graph object. |
label |
A character string. |
key |
A character string. |
An index already exists for any (label, key) pair that has a uniqueness constraint applied.
Attempting to add an index where a uniqueness constraint already exists results in an error.
Use getConstraint
to view any pre-existing uniqueness constraints.
If a uniqueness constraint already exists for the (label, key) pair, then it must be true that the index exists as well; adding an index is unnecessary.
1 2 3 4 5 6 7 8 9 | ## Not run:
graph = startGraph("http://localhost:7474/db/data/")
clear(graph)
createNode(graph, "Person", name="Alice", status="Employed")
addIndex(graph, "Person", "status")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.