SDK
SDK C# v2.x
2

ListAsync #

Returns the list of collections associated to a provided index.

The returned list is sorted in alphanumerical order. The from and size arguments allow pagination. They are returned in the response if provided.

Arguments #

public async Task<JObject> ListAsync(
      string index,
      int? from = null,
      int? size = null,
      TypeFilter type = TypeFilter.All
    );
ArgumentTypeDescription
index
string
Index name
from
int?

(null)
Offset of the first result
size
int?

(null)
Maximum number of returned results
type
TypeFilter

(All)
Filters the returned collections. Allowed values: All, Stored and Realtime (default : All).

Return #

A JObject representing the following object:

PropertyTypeDescription
type
string
Types of returned collections
(all, realtime or stored)
collections
JArray
List of collections

Each object in the collections array contains the following properties:

PropertyTypeDescription
name
string
Collection name
type
string
Collection type (realtime or stored)

Usage #

try {
  JObject collection_list = await kuzzle.Collection.ListAsync("mtp-open-data", 1, 2);
  Console.WriteLine(collection_list.ToString(Formatting.None));
  // {"type":"all","collections":[{"name":"pink-taxi","type":"stored"}],"from":1,"size":2}
} catch (Exception e) {
  Console.WriteLine(e);
}