property
How to specify a property from a traversal.
Synopsis
g.addV('vertexLabel') .[ property ('property\_key') ... ]
Description
The property()
step is a sideEffect.
When a vertex is added from a traversal g using addV
, properties can be added with property()
.
For a previously created vertex, properties can be added.
A previously created vertex label must be specified.
Property key-value pairs are specified.
Examples
Create a vertex with a vertex label person
with the properties personId
with value 17
and name
with value Jamie Oliver
:
g.addV('person').
property('personId', 17).
property('name','Jamie Oliver').next()
Add the properties gender
with value M
and nickname
with value jimmy
to a person
vertex previously created:
g.V().has('person', 'name', 'Jamie Oliver').
property('gender', 'M').
property('nickname', 'jimmy')
Add the property withSuppliedId
with value 341f9950-997c-11e7-9579-7f50358d3f8d
to a person
vertex:
// user-supplied property ID
g.addV('person').
property('withSuppliedId', 'propValue', T.id, UUID.fromString('341f9950-997c-11e7-9579-7f50358d3f8d'))