addIndex: Indexes

Description Usage Arguments Details See Also Examples

Description

Add an index to a node label and property key.

Usage

1
addIndex(graph, label, key)

Arguments

graph

A graph object.

label

A character string.

key

A character string.

Details

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.

See Also

getIndex, dropIndex

Examples

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)

nicolewhite/RNeo4j documentation built on May 23, 2019, 5:09 p.m.