How do I update an existing property of a node in a graph using Gremlin?
The following method creates two properties "timestamp" with 2 different values, instead of updating the existing property "timestamp":
ContentGraph.g.addV('Filter').property('timestamp', new Date());
ContentGraph.g.V().hasLabel('Filter').property('timestamp', new Date());
I am not sure which graph DB you are using but some, such as Amazon Neptune, have a default cardinality of set. You can override that cardinality setting using the Cardinality.single enum.
ContentGraph.g.addV('Filter').property('timestamp', new Date());
ContentGraph.g.V().hasLabel('Filter').property(single,'timestamp', new Date());
Hope that helps, Kelvin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With