<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Milan K Jain</title>
    <description>The latest articles on Forem by Milan K Jain (@milankj).</description>
    <link>https://forem.com/milankj</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3882922%2Fe7d44e0c-94ef-4696-82a8-f98a37b06c02.jpg</url>
      <title>Forem: Milan K Jain</title>
      <link>https://forem.com/milankj</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/milankj"/>
    <language>en</language>
    <item>
      <title>Simulating IoT Devices Without Physical Hardware 🚀</title>
      <dc:creator>Milan K Jain</dc:creator>
      <pubDate>Sun, 03 May 2026 07:47:47 +0000</pubDate>
      <link>https://forem.com/milankj/simulating-iot-devices-without-physical-hardware-29dk</link>
      <guid>https://forem.com/milankj/simulating-iot-devices-without-physical-hardware-29dk</guid>
      <description>&lt;p&gt;One of the recurring challenges while building IoT systems is testing device communication, telemetry handling, MQTT flows, and event-driven architectures without constantly relying on physical hardware. To solve this problem, I recently started building a lightweight IoT Simulator CLI focused on helping developers simulate virtual devices directly from the terminal.&lt;/p&gt;

&lt;p&gt;The project is designed for developers working on IoT platforms, MQTT brokers, RabbitMQ pipelines, telemetry ingestion systems, automation workflows, and real-time event processing. Instead of manually mocking payloads or depending on real devices during development, the simulator allows virtual devices to behave like actual connected hardware with configurable telemetry, topics, and runtime interactions.&lt;/p&gt;

&lt;p&gt;The current version focuses on providing a simple but flexible developer experience with config-driven device simulation and MQTT communication support. The goal is to make local IoT testing faster, easier, and more scalable while keeping the simulator lightweight and developer-friendly.&lt;/p&gt;

&lt;p&gt;This is still the first version, but there’s a lot planned ahead — including more advanced payload generators, richer simulation controls, better orchestration capabilities, and expanded protocol support.&lt;/p&gt;

&lt;p&gt;📦 npm Package: &lt;a href="https://www.npmjs.com/package/iot-simulator-cli" rel="noopener noreferrer"&gt;PACKAGE LINK&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Would love feedback from developers working with IoT systems, MQTT infrastructure, or event-driven architectures.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>iot</category>
      <category>testing</category>
      <category>tooling</category>
    </item>
    <item>
      <title>🚀 Fixing MongoDB Updates in n8n (No More Workarounds!)</title>
      <dc:creator>Milan K Jain</dc:creator>
      <pubDate>Thu, 16 Apr 2026 17:23:18 +0000</pubDate>
      <link>https://forem.com/milankj/fixing-mongodb-updates-in-n8n-no-more-workarounds-4l44</link>
      <guid>https://forem.com/milankj/fixing-mongodb-updates-in-n8n-no-more-workarounds-4l44</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;If you've ever used MongoDB with n8n, you've probably hit this limitation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The MongoDB node in n8n doesn’t actually support real MongoDB update operations.&lt;/p&gt;

&lt;p&gt;Yeah… that surprised me too.&lt;/p&gt;




&lt;h2&gt;
  
  
  😤 The Problem
&lt;/h2&gt;

&lt;p&gt;The existing update functionality is extremely limited:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only allows updating a &lt;strong&gt;single field&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Uses &lt;code&gt;updateKey&lt;/code&gt; + value&lt;/li&gt;
&lt;li&gt;Internally tied to &lt;code&gt;updateOne&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That means &lt;strong&gt;no support for native MongoDB update operators like:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;$set&lt;/code&gt; (multiple fields)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$pull&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$push&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$rename&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$inc&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🤯 Real-world limitation
&lt;/h2&gt;

&lt;p&gt;Let’s say you want to remove a value from an array:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"$pull"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"tags"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"deprecated"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Not possible in the current node.&lt;/p&gt;

&lt;p&gt;Or update multiple fields:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"$set"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"active"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"updatedAt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-01-01"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🧠 The Workarounds (that shouldn’t exist)&lt;/p&gt;

&lt;p&gt;Because of this, developers are forced to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use aggregation pipelines 😬&lt;/li&gt;
&lt;li&gt;Add Code nodes 🤯&lt;/li&gt;
&lt;li&gt;Chain multiple operations 😵
This defeats the purpose of using a low-code tool like n8n.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  💡 The Fix
&lt;/h2&gt;

&lt;p&gt;I created a PR that enables JSON-based update operations in the MongoDB node.&lt;/p&gt;

&lt;p&gt;✅ What’s new?&lt;/p&gt;

&lt;p&gt;You can now define:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A JSON filter&lt;/li&gt;
&lt;li&gt;A JSON update object
👉 Just like native MongoDB.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔥 Before vs After
&lt;/h2&gt;

&lt;p&gt;❌ Before&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One field update only&lt;/li&gt;
&lt;li&gt;No operators&lt;/li&gt;
&lt;li&gt;Limited flexibility&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;✅ After (JSON Mode)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"filter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"userId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"123"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"update"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"$set"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"active"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"$inc"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"loginCount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Clean&lt;br&gt;
👉 Flexible&lt;br&gt;
👉 Powerful&lt;/p&gt;

&lt;p&gt;🛠️ What this unlocks&lt;/p&gt;

&lt;p&gt;This change enables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Updating multiple fields in one operation.&lt;/li&gt;
&lt;li&gt;Using advanced operators like $pull, $push, $rename.&lt;/li&gt;
&lt;li&gt;Writing cleaner workflows.&lt;/li&gt;
&lt;li&gt;Removing unnecessary Code nodes.&lt;/li&gt;
&lt;li&gt;Aligning with native MongoDB behavior.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;⚙️ How it works&lt;/p&gt;

&lt;p&gt;A new mode is introduced:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Simple Mode (existing)&lt;/li&gt;
&lt;li&gt;Uses updateKey&lt;/li&gt;
&lt;li&gt;No changes&lt;/li&gt;
&lt;li&gt;JSON Mode (new)
Accepts raw JSON:&lt;/li&gt;
&lt;li&gt;Filter&lt;/li&gt;
&lt;li&gt;Update object
👉 Fully opt-in
👉 No breaking changes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;🧪 Stability&lt;br&gt;
✅ Backward compatible&lt;br&gt;
✅ Input validation (invalid / empty JSON)&lt;br&gt;
✅ Unit tests added&lt;br&gt;
✅ All existing tests passing&lt;br&gt;
🎯 Why this matters&lt;/p&gt;

&lt;p&gt;n8n is powerful because it bridges the gap between code and no-code.&lt;/p&gt;

&lt;p&gt;But limitations like this push developers back into writing code — unnecessarily.&lt;/p&gt;

&lt;p&gt;This change:&lt;/p&gt;

&lt;p&gt;✔ Reduces friction&lt;br&gt;
✔ Improves flexibility&lt;br&gt;
✔ Matches real MongoDB capabilities&lt;br&gt;
✔ Saves time for developers&lt;/p&gt;

&lt;p&gt;🚀 PR Link&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/n8n-io/n8n/pull/27583" rel="noopener noreferrer"&gt;https://github.com/n8n-io/n8n/pull/27583&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Would love feedback from the community and maintainers!&lt;/p&gt;

&lt;p&gt;💬 Final thought&lt;/p&gt;

&lt;p&gt;Sometimes the most impactful improvements aren’t flashy…&lt;/p&gt;

&lt;p&gt;They’re the ones that remove everyday friction.&lt;/p&gt;

&lt;p&gt;This is one of them.&lt;/p&gt;

</description>
      <category>n8n</category>
      <category>mongodb</category>
      <category>mongodbnode</category>
    </item>
  </channel>
</rss>
