Check Key Existence Action Steps
- Action Definition
- Open your project on the Kuika platform.
- Click the Add Action button on the right side and select the Check Key Existence action.
- Cache Key Determination
- Select the key you want to check. This key must have been added previously with Push To Cache.
- Example: user_123_filters
- Using the Cache Provider
- Must be the same as the cache provider where the key is located (InMemory, Redis, Mongo, or SQL).
- Running and Testing the Action
- Run the action in Preview mode.
- As output, you can verify whether the key is in the cache.
- If you are using Redis, you can check the existence of the key via the terminal with redis-cli -h localhost -p 6379.
Important Points
- The Check Key Existence action is only valid for keys added with Push To Cache or already existing in the cache.
- When InMemory is selected, the key will be lost because the values will be deleted when the application is closed.
- If the key is not found, the action may return false or an error; it is important to add conditions accordingly in subsequent actions.