Content Rules

By default, Medis attempts to select the most suitable encoder and viewer based on the content of the key. However, in certain scenarios, this automatic detection may fail. Additionally, the automatic detection does not take custom encoders into consideration, primarily due to performance constraints.

To address these limitations, Medis allows users to configure explicit content rules for encoders and viewers, based on the key name or type. This enables users to customize the encoding and decoding process, ensuring that the appropriate encoder and viewer are used for each key.

Create a New Rule

To create a new rule, open the connection config modal and select the content rules tab.

Click the + button to create a new rule.


There are two conditions, and only when the two conditions are satisfied at the same time, the preferred viewer and encoder will apply. If the key name pattern is left empty, all key names pass the condition.

The key name pattern supports glob rules like * and ?.


You can set either viewer or encoder or both of them. "Auto" is Medis's default behavior. For Hash/List/Set/Sorted Set keys, the viewer/encoder will be applied to their fields.

Last updated