-
Notifications
You must be signed in to change notification settings - Fork 95
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
Support for keepNull
and specifying the return type on insertDocuments
#373
Comments
Unfortunately the current Java driver does not allow using About the return type, what would you like to achieve? Can you describe your use case more in detail? |
I'm building something roughly along the CQRS pattern where I have a command object that includes the operation (create or update) and the JSON (as a Jackson ObjectNode) to send to Arango. My input is always an ObjectNode as that's what our audit system wants and our "managers" produce (so the user might send a request to the API to update field A, this is sent to the relevant "manager" class which will build a ObjectNode containing the change (updating field A might also mean updating field B (e.g. updatedAt)). The end result of this is a list of changes that need to be applied to the database. In the ideal world I would like to just run an upsert type operation where I can give Arango the changes and if the key exists it does an update and if not an insert - but to do this I would need to set keepNulls: false so I can delete attributes. I'm currently making separate calls to insert and update (which isn't a problem really - it would just be nice if it could be done in one operation). The update call is fine - I give it my ObjectNode and a Class; it applies the patch and returns the updated object deserialized to the provided class. The insert call however doesn't have an option for passing the class I would like back - it always deserializes to the same type provided (so I give it an ObjectNode and it gives me back an ObjectNode). I'm currently getting around this by using Jackson to convert from ObjectNode to MyClass. |
As of now, you can workaround both problems performing an On the other side, implementing About the return type, I agree to implement an overloaded version of |
Since vertion 7.0.0, keepNull behavior can be specified using Jackson API by:
Also, https://github.com/arangodb/arangodb-java-driver/releases/tag/v7.0.0-RC.4 |
Closing as fixed in version 7.0.0.
Also, |
I'm trying to use collection.insertDocuments to support upsert but it doesn't support the keepNull property or specifying a custom return type.
Similar to #343.
I would like to be able to do this:
The text was updated successfully, but these errors were encountered: