Sets

A set is a collection of strings. They have a property which does not allow repeated values. It means that if we add the pre-existing value on the sets, it will result in the same element, in this case, the advantage is not necessary to verify if the element exists on the set. Another important characteristic is that the sets are unordered. This behavior is different from the Redis lists. It can be useful in different use cases such as count the unique visitor, track the unique IPs, and much more.

Get Spring 5.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.