GetMappingAsync

Returns the mapping for the given collection.

Arguments

Copied to clipboard!
public async Task<JObject> GetMappingAsync(
        string index,
        string collection);
Argument Type Description
index
string
Index name
collection
string
Collection name

Return

A JObject representing the collection data mapping.

Usage

Copied to clipboard!
try {
  JObject mapping = await kuzzle.Collection.GetMappingAsync("nyc-open-data", "yellow-taxi");

  Console.WriteLine(mapping["properties"]?.ToString(Formatting.None));
  // {"properties":{"license":{"type":"keyword"},"driver":{"properties":{"name":{"type":"keyword"},"curriculum":{"type":"text"}}}}}
} catch (Exception e) {
  Console.WriteLine(e);
}