Skip to content
Max De Marzi edited this page Jun 2, 2014 · 3 revisions

List node labels:

@neo.list_labels                                           # List all the labels in the graph

Add labels to a node:

@neo.add_label(node, "Person")                             # Add the label "Person" to a node
@neo.add_label(node, ["Actor", "Director"])                # Add the labels "Actor" and "Director" to a node

Set labels of a node:

@neo.set_label(node, "Person")                             # Set the label of a node to "Person"
@neo.set_label(node, ["Actor", "Director"])                # Set the labels of a node to "Actor" and "Director"

Delete a label from a node:

@neo.delete_label(node, "Actor")                           # Delete a label from a node
@neo.get_schema_index("person")                            # Get the indexes of the person label

List nodes that have a label:

@neo.get_nodes_labeled("Actor")                             # Get all the nodes labeled "Actor" in the graph
@neo.find_nodes_labeled("Actor", {:name => "Tom Hanks"})  # Find all the "Actors" named "Tom Hanks"

Get the labels of one node:

@neo.get_node_labels(id)                                    # Get all the labels of a node
Clone this wiki locally