Skip to content
This repository was archived by the owner on Sep 28, 2022. It is now read-only.

Add document:mDelete#66

Merged
y-abs merged 11 commits into
3-devfrom
KZL-1350-document-mDelete
Mar 4, 2020
Merged

Add document:mDelete#66
y-abs merged 11 commits into
3-devfrom
KZL-1350-document-mDelete

Conversation

@y-abs
Copy link
Copy Markdown
Contributor

@y-abs y-abs commented Feb 28, 2020

What does this PR do ?

This PR implements the mDelete method with its unit tests.

How should this be manually tested?

Clone this branch and run unit tests
./gradlew test

When it succeed, compile it

./gradlew jar

Initiate another java project by adding the compiled SDK as a dependency.

Then, run Kuzzle, create an index nyc-open-data and a yellow-taxi collection in the admin console. Create 2 documents with id some-id1 and some-id2.
Finally, run this code

import io.kuzzle.sdk.*;
import io.kuzzle.sdk.Options.KuzzleOptions;
import io.kuzzle.sdk.Options.Protocol.WebSocketOptions;
import io.kuzzle.sdk.Protocol.WebSocket;

import java.util.concurrent.ConcurrentHashMap;

public class mDeleteDocument {
    private static Kuzzle kuzzle;

    public static void main(String[] args) {
        WebSocketOptions opts = new WebSocketOptions();
        opts.setAutoReconnect(true).setConnectionTimeout(42000);

        try {
            WebSocket ws = new WebSocket("localhost", opts);

            kuzzle = new Kuzzle(ws, (KuzzleOptions) null);

            kuzzle.connect();

            final ArrayList<String> ids = new ArrayList<>();
            ids.add("some-id1");
            ids.add("some-id2");

            ConcurrentHashMap<String, ArrayList<Object>> result = 
            kuzzle.getDocumentController().mDelete("nyc-open-data", "yellow-taxi", ids)
            .get();

            System.out.println(result);
        }  catch (Exception e) {
            e.printStackTrace();
        }

        kuzzle.disconnect();
    }
};

You should see the documents in your collection.

@y-abs y-abs self-assigned this Feb 28, 2020
Comment thread doc/3/controllers/document/m-delete/index.md Outdated
Comment thread doc/3/controllers/document/m-delete/index.md Outdated
Comment thread doc/3/controllers/document/m-delete/index.md Outdated
y-abs and others added 3 commits March 2, 2020 10:46
Co-Authored-By: Adrien Maret <amaret93@gmail.com>
Co-Authored-By: Adrien Maret <amaret93@gmail.com>
Co-Authored-By: Adrien Maret <amaret93@gmail.com>
@y-abs y-abs merged commit 28ca5ca into 3-dev Mar 4, 2020
@y-abs y-abs deleted the KZL-1350-document-mDelete branch March 4, 2020 15:58
@jenow jenow mentioned this pull request May 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants