SDK
SDK Android v3.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

mGetDocument #

Get multiple Documents according to the input document IDs.


mGetDocument(documentIds, [options], callback) #

ArgumentsTypeDescription
documentIdsString[]Array of IDs of documents to retrieve
optionsJSON ObjectOptional parameters
callbackfunctionCallback handling the response

Options #

OptionTypeDescriptionDefault
queuablebooleanMake this request queuable or nottrue

Callback Response #

Returns a JSON object containing the raw Kuzzle response.

Usage #

String[] documentIds = new String[]{"doc1", "doc2"};
kuzzle
  .collection("collection", "index")
  .mGetDocument(documentIds, new ResponseListener<JSONObject>() {
    @Override
    public void onSuccess(JSONObject object) {
      // callback called once the mGet operation has completed
      // => the result is a JSON object containing the raw Kuzzle response
    }
    @Override
    public void onError(JSONObject error) {
      // Handle error
    }
  });

Callback response:

{
  "hits": [
    { "_id": "doc1", "first": "document" },
    { "_id": "doc2", "second": "document" }
  ],
  "total": 2
}