Ask Your Question
3

How can I remove specific nodes from a list of values using a Gremlin query?

asked 2023-06-10 23:28:34 +0000

scrum gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-06-10 23:32:02 +0000

lakamha gravatar image

You can remove specific nodes from a list of values using the not step in a Gremlin query. Here's an example query:

g.V().hasLabel('person').values('name').not('Alice', 'Bob')

In this query, g.V().hasLabel('person').values('name') retrieves the list of all person vertices' name property values. The not('Alice', 'Bob') step filters out the values 'Alice' and 'Bob' from the list.

Note that this query only filters out values from the list and does not remove nodes from the graph. If you want to remove nodes from the graph, you can use the drop() step after filtering the nodes.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-10 23:28:34 +0000

Seen: 22 times

Last updated: Jun 10 '23