Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the Java Driver Support retrieving modified documents? #597

Open
jdc-developer opened this issue Jan 21, 2025 · 1 comment
Open

Does the Java Driver Support retrieving modified documents? #597

jdc-developer opened this issue Jan 21, 2025 · 1 comment
Labels

Comments

@jdc-developer
Copy link

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.

@rashtao
Copy link
Collaborator

rashtao commented Jan 22, 2025

Note that version 6 reached EOL and is therefore not supported anymore. Upgrading to version 7 is recommended.

If the issue remains, in version 7 you can enable debug level logging for the logger com.arangodb.internal.net.Communication to log the requests and responses, and double check whether the query returns actual data to the driver or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants