jsonArrIndex method
jsonArrIndex
Implementation
Future<int> jsonArrIndex(
String key,
Object value, {
String path = '\$',
int? start,
int? end,
}) async {
Object result = await _runWithRetryNew(() async {
return (await RespCommandsTier1(_client!).jsonArrIndex(
key: key, path: path, value: value, start: start, end: end));
});
if (result is RespType2<dynamic>) {
final result1 = result.toArray().payload;
if (result1 != null && result1.isNotEmpty) {
return result1[0].payload as int;
} else {
throw Exception('jsonArrIndex: No elements in the result list');
}
}
final result1 = (result as RespType3<dynamic>).toArray().payload;
if (result1 != null && result1.isNotEmpty) {
return result1[0].payload as int;
} else {
throw Exception('jsonArrIndex: No elements in the result list');
}
}