arangodb / arangojs

The official ArangoDB JavaScript driver.
https://arangodb.github.io/arangojs
Apache License 2.0
600 stars 106 forks source link

Migration guide from v6 to v7 leaves out important changes to update revision handling #703

Closed robross0606 closed 3 years ago

robross0606 commented 3 years ago

The migration guide doesn't mention that the rev option appears to no longer be available on collection.update(). I have ignoreRevs set to false in the options section of collection.update(). This worked previously by also passing in the rev option at the same spot we passed in ignoreRevs. This appears to be ignored now. Our unit tests are failing because revision of "BOGUS" is being completely ignored by the update() call. I'm assuming that, instead, the value must be passed in with the input data but it isn't made clear anywhere in the documentation. Do you have migration guide suggestions for how to handle update revisions?

pluma commented 3 years ago

arangojs v6 supported the if-match header, v7 does not. The header is redundant as the same behavior can be achieved by setting the _rev property on the document itself.

Can you try setting _rev on the payload instead of rev on the options and report back whether that works? I would then adjust the migration guide accordingly.

pluma commented 3 years ago

I'm closing this as a duplicate of #707 as that issue provides more additional information and the solution seems to be to re-implement the if-match header from v6.