0
我想使用Redis存儲產品的數量及其ID。以下是我現在所擁有的:使用Redis導軌購物車:存儲項目數量
def add
$redis.sadd current_user_cart, params[:product_id]
redirect_to carts_show_path(current_user_cart)
render json: current_user.cart_count, status: 200
end
如何在單個密鑰中存儲多個值?我需要使用散列嗎?