Add collection:truncate#80
Conversation
|
|
||
| ## Returns | ||
|
|
||
| A `ConcurrentHashMap` which has an `acknowledged` Boolean. |
There was a problem hiding this comment.
IMHO, you can return nothing
There was a problem hiding this comment.
The API returns it
https://docs.kuzzle.io/core/2/api/controllers/collection/truncate/
There was a problem hiding this comment.
The API returns an acknowledgement. This is a way of saying: "the query has been accepted and it ran fine, but there is no result to return".
So, in a SDK, this is a same than a function returning normally. Bothering with creating a ConcurrentHashMap just to return an acknowledgement has no point.
There was a problem hiding this comment.
And to me, this warrants a "requested change", so I'm going to block this PR over this issue.
Co-Authored-By: Adrien Maret <amaret93@gmail.com>
Co-Authored-By: Adrien Maret <amaret93@gmail.com>
scottinet
left a comment
There was a problem hiding this comment.
API acknowledgements are not return values.
| import io.kuzzle.sdk.Kuzzle; | ||
|
|
||
| import java.util.concurrent.CompletableFuture; | ||
| import java.util.concurrent.ConcurrentHashMap; |
There was a problem hiding this comment.
This dependency seems unused
What does this PR do ?
This PR implements the
collection:truncatemethod with its unit tests.How should this be manually tested?
Clone this branch and run unit tests
./gradlew testWhen it succeed, compile it
./gradlew jarInitiate another java project by adding the compiled SDK as a dependency.
Then, run Kuzzle, create an index
nyc-open-data, ayellow-taxicollection with several documents in it.Finally, run this code