Skip to content

Ability to set vertex or edge ID #98

@mbbfyb

Description

@mbbfyb

In looking through the code for goblin and aiogremlin I can't see to figure out how to set the vertex or edge ID to a user defined value.

I would presume it would be something as simple as

class Person(goblin.Vertex):
    id = goblin.Property(goblin.String)
    # or
    _id = goblin.Property(goblin.String)

But in looking at this file there seems to be a lot of special handling for the id values. I found this which lead me down the path of something similar to

class Person(goblin.Vertex):
    id = goblin.Property(properties.IdProperty(data_type=goblin.String), default='abc123')

but the id doesnt seem to stick when I set the vertex and then check the id value.

Can you point me in the right direction?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions