SDK
SDK C# v2.x
2

ExistsAsync #

Checks if a collection exists in Kuzzle.

Arguments #

public async Task<bool> ExistsAsync(
    string index,
    string collection);
ArgumentTypeDescription
index
string
Index name
collection
string
Collection name

Return #

A boolean indicating if the collection exists or not.

Exceptions #

Throws a KuzzleException if there is an error. See how to handle error.

Usage #

try {
  bool exists = await kuzzle.Collection.ExistsAsync("nyc-open-data", "green-taxi");
  if (exists) {
    Console.WriteLine("Collection green-taxi exists");
  }
} catch (Exception e) {
  Console.WriteLine(e);
}