Skip to content

collection.updateDocuments ,collection. replaceDocuments not working for JSON strings #98

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

Closed
divyajana21 opened this issue Feb 1, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@divyajana21
Copy link

divyajana21 commented Feb 1, 2017

Working with the arangodb java driver trying to do bulk operations, we're encountering that while the driver will allow us to update a single document as a json string (Key, Js string):

val js = ObjectToJson(obj).toString
db.collection.updateDocument(String,js)

it will not allow us to update a set of documents as Map(String,json string):
val js = ObjectToJson(obj).toString
db.collection.updateDocuments(Map(String,String))

Similarly, we are trying to do bulk operation on replaceDocuments

It allows,
val js = ObjectToJson(obj).toString
db.collection.replaceDocument(String,js)
but not,
db.collection.replaceDocuments(Map(String,String))

@mvollmary
Copy link

Hi,
the methods updateDocuments/replaceDocuments work with Collection<String> in the case of working with raw Json. You have to build the _key of the document - you want to update - in the document. (see here for example)

But beside that I find a bug in this methods, so thanks for reporting. I fixed it. You can test it with current snapshot version 4.1.8-SNAPSHOT. I will release a new version (4.1.8) within this week.

Thanks & Best
Mark

@mvollmary mvollmary self-assigned this Feb 2, 2017
@mvollmary mvollmary added the bug label Feb 2, 2017
@mvollmary mvollmary added this to the 4.1.8 milestone Feb 2, 2017
@mvollmary
Copy link

fixed in version 4.1.8

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