SDK
SDK C# v2.x
2

DeleteAsync #

Deletes a document.

Arguments #

Copied to clipboard!
public async Task<string> DeleteAsync(
  string index, 
  string collection, 
  string id, 
  bool waitForRefresh = false);


Argument Type Description
index
string
Index name
collection
string
Collection name
id
string
Document ID
waitForRefresh
bool

(false)
If true, waits for the change to be reflected for search (up to 1s)

Return #

The ID of the deleted document.

Exceptions #

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

Usage #

Copied to clipboard!
try {
  string id = await kuzzle.Document.DeleteAsync(
    "nyc-open-data",
    "yellow-taxi",
    "some-id");
  Console.WriteLine($"Document {id} successfully deleted");
} catch (KuzzleException e) {
  Console.Error.WriteLine(e);
}