linsert method

Future<int> linsert(
  1. String key,
  2. InsertMode insertMode,
  3. Object pivot,
  4. Object value,
)

Inserts value in the list stored at key either before or after the reference value pivot.

When key does not exist, it is considered an empty list and no operation is performed.

An error is returned when key exists but does not hold a list value.

Returns the length of the list after the insert operation, or -1 when the value pivot was not found.

Implementation

Future<int> linsert(String key, InsertMode insertMode, Object pivot, Object value) async {
  return (await tier1.linsert(key, insertMode, pivot, value)).toInteger().payload;
}