2

Following tutorials that is using ServiceStack v3 and stuck at when trying to trim a list in V4.

What is the equivalent in V4? Trying to google examples but with no luck.

lai tang
  • 169
  • 1
  • 6

1 Answers1

2

You can just use TrimList, e.g:

redis.TrimList(listId, keepStartingFrom, keepEndingAt);

Or you can use Trim() off IList, e.g:

redis.Lists[listId].Trim(keepStartingFrom, keepEndingAt);

Both TrimList() and IRedisList.Trim() also have Redis Typed Client API versions:

redis.As<Poco>().TrimList(listId, keepStartingFrom, keepEndingAt);
redis.As<Poco>().Lists[listId].Trim(keepStartingFrom, keepEndingAt);
mythz
  • 141,670
  • 29
  • 246
  • 390