Description Usage Arguments Details See Also Examples
View source: R/addConstraint.R
Add a uniqueness constraint to a label and property key.
1 | addConstraint(graph, label, key)
|
graph |
A graph object. |
label |
A character string. |
key |
A character string. |
A uniqueness constraint cannot be added to a (label, key) pair that already has an index applied.
Attempting to add a uniqueness constraint where an index already exists results in an error.
Use getIndex
to view any pre-existing indexes.
If you wish to add a uniqueness constraint, use dropIndex
to drop the index.
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
graph = startGraph("http://localhost:7474/db/data/")
clear(graph)
addConstraint(graph, "Person", "name")
createNode(graph, "Person", name = "Alice")
createNode(graph, "Person", name = "Bob")
try(createNode(graph, "Person", name = "Alice"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.