Skip to content

Updating records without mangling edges #4

@ryan-stateless

Description

@ryan-stateless

I'm playing around with the pyorient driver and I've encountered a "I must be doing it wrong" problem.
Consider this sample code:

orient_client.db_open( "database", "admin", "admin" )
record = orient_client.query("select from V where some_field = 'some value'")[0]
cluster_id = parse_cluster_id(record._rid)
cluster_position = parse_cluster_position(record._rid)
record.oRecordData["some_field"] = "some other value"
orient_client.record_update(cluster_id, cluster_position, record)

When I run this code the field is updated correctly, however the IN/OUT edges get mangled. This is because the deserialization of binary data in the query result stores the edges as OrientBinaryObject (base64 strings). When the record_update() is written, the edge collections are stomped with these strings.

How do I read, update, write without tripping over the missing ridbag handling in pyorient?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions