Comment on Adding view count and like button to 11typarentComments−chillingOP2yso how would you approach this?−porridgeraisin2yJust do hincrby alone, if it doesn't exist it will automatically become 1−chillingOP2yYou are right. It just should be like so:Get: const likes = (await kv.hget(postTitle, "likes")) || 0 Post: const likes = await kv.hincrby(postTitle, "likes", 1);
Comments
so how would you approach this?
Just do hincrby alone, if it doesn't exist it will automatically become 1
You are right. It just should be like so:
Get:
Post: