update method
Updates a data collection
data mappings
.
TODO: check if mappings/settings are optional or both are necessary
Warning: While updating the collection settings, the collection will be closed until the new configuration has been applied.
Implementation
Future<Map<String, dynamic>> update(
String index,
String collection,
Map<String, dynamic> mappings,
Map<String, dynamic> settings,
) async {
final body = <String, dynamic>{};
if (mappings != null) {
body['mappings'] = mappings;
}
if (settings != null) {
body['settings'] = settings;
}
final response = await kuzzle.query(KuzzleRequest(
index: index,
collection: collection,
controller: name,
action: 'update',
body: body,
));
return response.result as Map<String, dynamic>;
}