<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ramanan R on Medium]]></title>
        <description><![CDATA[Stories by Ramanan R on Medium]]></description>
        <link>https://medium.com/@ramananrpn?source=rss-9cc620af4673------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*PpLpSIcSicreSOfz8fvIBA.jpeg</url>
            <title>Stories by Ramanan R on Medium</title>
            <link>https://medium.com/@ramananrpn?source=rss-9cc620af4673------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 13:44:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ramananrpn/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[When AI Writes Code That “Works”: Why Human Expertise Still Matters at Scale]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">Recently, I collaborated with an AI agent to build a data aggregation API. The implementation was elegant, the tests were green, and the&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@ramananrpn/when-ai-writes-code-that-works-a-cautionary-tale-on-performance-at-scale-5460ec938059?source=rss-9cc620af4673------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@ramananrpn/when-ai-writes-code-that-works-a-cautionary-tale-on-performance-at-scale-5460ec938059?source=rss-9cc620af4673------2</link>
            <guid isPermaLink="false">https://medium.com/p/5460ec938059</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai-assisted-coding]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[engineering-excellence]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Ramanan R]]></dc:creator>
            <pubDate>Sun, 15 Feb 2026 09:30:16 GMT</pubDate>
            <atom:updated>2026-02-15T09:33:23.568Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to Bulk Rename Fields in Hash for Multiple Keys with a pattern in Redis]]></title>
            <link>https://medium.com/@ramananrpn/how-to-bulk-rename-fields-in-hash-for-multiple-keys-with-a-pattern-in-redis-4e8ad8987a0?source=rss-9cc620af4673------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e8ad8987a0</guid>
            <category><![CDATA[redis]]></category>
            <category><![CDATA[lua]]></category>
            <dc:creator><![CDATA[Ramanan R]]></dc:creator>
            <pubDate>Sun, 12 Jul 2020 08:43:27 GMT</pubDate>
            <atom:updated>2020-07-12T08:47:45.770Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UJ-qE5aZ1PuTAfAQ.png" /></figure><p>Lets say I have some set of hash stored in Redis with a key pattern user:*</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*Xy7XqQgWMxd4Emd49TklMw.png" /></figure><pre>Key : <strong>user:1<br></strong>Type: <strong>Hash</strong></pre><pre><strong>Field       Value</strong><br>id            1<br>name         Ramanan<br>role     software engineer<br></pre><p>Now , Im thinking to rename the hash field</p><ul><li>id to user_id</li><li>name to user_name</li></ul><p><strong>Redis does not have a direct way to rename fields within a hash. But more importantly, there is no way to do it for all the hashes you have created.</strong></p><p>Fortunately, a little command line magic will help us to do this.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c23a37793d55e19b1f3c969cbe6f07a/href">https://medium.com/media/6c23a37793d55e19b1f3c969cbe6f07a/href</a></iframe><p>Redis does not have a hrename command, so we first write one in lua script. This command will rename fields within a single hash.</p><p>evalsha &lt;script-sha1-identifier&gt; 1 &lt;key&gt; &lt;old-field-1&gt; &lt;new-field-1&gt;...</p><p>You will need to first load the script. The command cat hrename.lua | redis-cli -x script load loads the script and returns a SHA1 identifier. You can use this identifier whenever you want to invoke the script.</p><h3>Renaming Fields in Multiple Hashes</h3><p>Now that we have a command to fix a single hash, we need to run it in a loop for all the hashes that match a pattern. The script hash_bulk_rename_fields.sh does just that.</p><ol><li>First, we use redis-cli --scan --pattern &lt;pattern&gt; to get a list of keys, one key per line.</li><li>Next, we pass the keys through grep. Redis scan command does not accept regular expressions, so we do basic filtering with scan, and then provide a better regular expression via grep.</li><li>We then run an awk script for each key. This awk script is a little complex, so we will break it down</li><li>The awk script has a command template evalsha &lt;sha1&gt; 1 __key__ &lt;old field name&gt; &lt;new field name&gt;... This is the command that will run for all keys.</li><li>For each matching key, the awk command replaces __key__ with the actual key</li><li>Next, we convert the string command to <a href="https://redis.io/topics/protocol">redis protocol format</a>. This is the raw format that redis understands.</li><li>Finally, we pipe the raw commands to redis-cli using the –pipe flag. This is the most efficient way to send bulk commands to redis.</li></ol><h3>Customizing this Script</h3><ol><li>You can change --pattern and the grep command to select the keys that are of type hash</li><li>You can customize cmd_template to include the fields you want to rename</li><li>If your redis server is not on localhost, you will have to provide the host, port and password <strong>twice</strong> in the command, basically whenever you call redis-cli.</li></ol><p>Hurray!!! Hope this helps .</p><p>Thanks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e8ad8987a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>