Skip to content

Does the Java Driver Support retrieving modified documents? #597

Open
@jdc-developer

Description

@jdc-developer

Hello,
I'm facing an issue on driver version 6.5.0
I can't get proper results on an AQL which uses the "OLD" value from an UPDATE operation.

LET now = DATE_ISO8601(DATE_NOW()) FOR doc IN handledTag FILTER doc._handling == '5543664149' COLLECT barcode = doc.barcode, grupo = doc.product.grupo, handling = doc._handling, establishment = doc._establishment AGGREGATE description = max(doc.description), dco = max(doc.product.dco), lido = count(doc._key) LET oldLido = ( FOR doc2 IN itemFile FILTER doc2._handling == '5543664149' AND doc2.remessa == '36602012023' AND doc2.barcode == barcode RETURN doc2.lido ) UPSERT { barcode, remessa: '36602012023' } INSERT { barcode, remessa: '36602012023', description, grupo, dco, lido, quantity: 0, _handling: handling, _establishment: establishment, accuracy: 0, conferido: false, created_at: now, updated_at: now, hasChanged: false } UPDATE { accuracy: OLD.quantity ? FLOOR((lido / OLD.quantity) * 100) : 0, _handling: handling, _establishment: establishment, updated_at: now, hasChanged: OLD.lido == null ? false : lido > OLD.lido } IN itemFile RETURN { aqlRes: oldLido[0], old: OLD }

This is a quite complex AQL. But, basically, I need to get data from a collection, and update data based on these filters on another collection.
It all works fine, but the OLD result is not working properly on Java. The value that I want to use on OLD is "lido", and I can't get its value on Java, it always returns zero. Nevertheless, this AQL works on the web interface, and OLD.lido returns its value properly.
I also did another AQL "oldLido" to retrieve this same value. And the very same thing happens, and its result is zero on Java only.
Can you please, help me. Give me an advice and let me know if this specific feature does not work on ArangoDB Java Driver?
Thank you in advance.

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