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

ReplaceDocuments does an Update (PATCH) instead of a Replace (PUT) #644

Open
Kafkalasch opened this issue Dec 6, 2024 · 1 comment
Open

Comments

@Kafkalasch
Copy link

When trying to replace documents (note the plural, it does work with ReplaceDocument correctly), the v2 version of the arangodriver has a bug and does an Update (that merges changes) instead of a replace.

You can see the error in collection_documents_replace_impl.go in line 100:

func (c collectionDocumentReplace) ReplaceDocumentsWithOptions(ctx context.Context, documents interface{}, opts *CollectionDocumentReplaceOptions) (CollectionDocumentReplaceResponseReader, error) {
// ...
req, err := c.collection.connection().NewRequest(http.MethodPatch, url) // <-- THIS SHOULD BE A http.MethodPut
// ...
@Kafkalasch
Copy link
Author

Here is the fix: #645

Seems like I need to sign something. Feels like a hassle just for a single line of code change.

Please feel free to fix it yourself

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

No branches or pull requests

1 participant