ExistsAsync

Checks if a collection exists in Kuzzle.

Arguments

Copied to clipboard!
public async Task<bool> ExistsAsync(
    string index,
    string collection);
Argument Type Description
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

Copied to clipboard!
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);
}