<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Reactive REST API with Micronaut and MongoDB	</title>
	<atom:link href="https://blog.codersee.com/reactive-rest-api-with-micronaut-and-mongodb/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.codersee.com/reactive-rest-api-with-micronaut-and-mongodb/</link>
	<description>Kotlin &#38; Backend Tutorials - Learn Through Practice.</description>
	<lastBuildDate>Wed, 16 Apr 2025 04:50:05 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Eric		</title>
		<link>https://blog.codersee.com/reactive-rest-api-with-micronaut-and-mongodb/#comment-73</link>

		<dc:creator><![CDATA[Eric]]></dc:creator>
		<pubDate>Fri, 25 Nov 2022 14:08:04 +0000</pubDate>
		<guid isPermaLink="false">https://codersee.com/?p=5503861#comment-73</guid>

					<description><![CDATA[&quot;nested&quot; 🤔
That&#039;s interesting. A flatmap untangles the nest. I like it!
Or maybe think of it like how a flat iron, that women use to straighten hair, gets rid of the curls. We&#039;re eliminating data curliness 😆
These are great images to help me &quot;untangle&quot; the idea of a flatmap.]]></description>
			<content:encoded><![CDATA[<p>&#8220;nested&#8221; 🤔<br />
That&#8217;s interesting. A flatmap untangles the nest. I like it!<br />
Or maybe think of it like how a flat iron, that women use to straighten hair, gets rid of the curls. We&#8217;re eliminating data curliness 😆<br />
These are great images to help me &#8220;untangle&#8221; the idea of a flatmap.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Piotr		</title>
		<link>https://blog.codersee.com/reactive-rest-api-with-micronaut-and-mongodb/#comment-72</link>

		<dc:creator><![CDATA[Piotr]]></dc:creator>
		<pubDate>Mon, 21 Nov 2022 16:38:08 +0000</pubDate>
		<guid isPermaLink="false">https://codersee.com/?p=5503861#comment-72</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://blog.codersee.com/reactive-rest-api-with-micronaut-and-mongodb/#comment-71&quot;&gt;Eric&lt;/a&gt;.

Of course agree with you, but I remember that I once saw on StackOverflow that someone explained it that &quot;flat&quot; is the opposite of &quot;nested&quot; and flattening is a removal of one nesting level 🙂
Since then it resonates a bit better with me 😁]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://blog.codersee.com/reactive-rest-api-with-micronaut-and-mongodb/#comment-71">Eric</a>.</p>
<p>Of course agree with you, but I remember that I once saw on StackOverflow that someone explained it that &#8220;flat&#8221; is the opposite of &#8220;nested&#8221; and flattening is a removal of one nesting level 🙂<br />
Since then it resonates a bit better with me 😁</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Eric		</title>
		<link>https://blog.codersee.com/reactive-rest-api-with-micronaut-and-mongodb/#comment-71</link>

		<dc:creator><![CDATA[Eric]]></dc:creator>
		<pubDate>Mon, 21 Nov 2022 16:08:20 +0000</pubDate>
		<guid isPermaLink="false">https://codersee.com/?p=5503861#comment-71</guid>

					<description><![CDATA[Totally answered it! I think the &quot;flatten&quot; term here might be getting in the way? There&#039;s probably not a better name, but the word &quot;flat&quot;, in this context, has never really resonated with me for some reason. Maybe something like &quot;single&quot; would make more sense to me? If you&#039;re dealing with multiple dimensions of arrays, or in this case, a compounding of objects, and use flatMap, you&#039;re really after a single array or single object. Unless something makes the word &quot;flat&quot; make sense to me, I think I&#039;m calling this a singleMap (in my head), from now on :)]]></description>
			<content:encoded><![CDATA[<p>Totally answered it! I think the &#8220;flatten&#8221; term here might be getting in the way? There&#8217;s probably not a better name, but the word &#8220;flat&#8221;, in this context, has never really resonated with me for some reason. Maybe something like &#8220;single&#8221; would make more sense to me? If you&#8217;re dealing with multiple dimensions of arrays, or in this case, a compounding of objects, and use flatMap, you&#8217;re really after a single array or single object. Unless something makes the word &#8220;flat&#8221; make sense to me, I think I&#8217;m calling this a singleMap (in my head), from now on 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Piotr		</title>
		<link>https://blog.codersee.com/reactive-rest-api-with-micronaut-and-mongodb/#comment-70</link>

		<dc:creator><![CDATA[Piotr]]></dc:creator>
		<pubDate>Fri, 18 Nov 2022 15:24:37 +0000</pubDate>
		<guid isPermaLink="false">https://codersee.com/?p=5503861#comment-70</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://blog.codersee.com/reactive-rest-api-with-micronaut-and-mongodb/#comment-69&quot;&gt;Eric&lt;/a&gt;.

A reactive approach and to be more specific here- a Project Reactor definitely are worth learning (and even if we won&#039;t use them in any project it&#039;s a great way to strech our brains and think outside the box). On the other hand, this shift from a &quot;standard&quot; approach is a bit painful (and the infographics from the documentation do not help- at least in my case when I saw them for the first time 🙂).
Either way- as with probably every new technology- a bit of pain and sweat and it becomes easier. 
Finally, answering the question (I know, I had to add a bit of storytelling 😏):
&lt;ul&gt;
 &lt;li&gt; a &lt;strong&gt;map&lt;/strong&gt; function takes a &lt;code&gt;Function&lt;/code&gt; as an argument &lt;/li&gt;
 &lt;li&gt; a &lt;strong&gt;flatMap&lt;/strong&gt; takes a &lt;code&gt;Function&#060;T, Publisher&#062;&lt;/code&gt;  &lt;/li&gt;
&lt;/ul&gt;

In the example above-  the &lt;code&gt;articleRepository.update&lt;/code&gt; function returns a Mono (which implements a Publisher), so we have to use the &lt;code&gt;flatMap&lt;/code&gt;- otherwise we would end up with a &lt;code&gt;Mono&#060;Mono&#060;T&#062;&#062;&lt;/code&gt; instead (just like flatMap in streams API flattens the structure and allows to avoid Stream&#060;Stream&#062; structure). 
And maybe I wouldn&#039;t use the term &quot;flatten&quot; in terms of the Project Reactor, I believe this comparison is a good way to start with in the beginning and gradually learn other concepts, like subscriptions etc.

Hope this answer helps (and even I sweated a bit when trying to describe it)! 😁]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://blog.codersee.com/reactive-rest-api-with-micronaut-and-mongodb/#comment-69">Eric</a>.</p>
<p>A reactive approach and to be more specific here- a Project Reactor definitely are worth learning (and even if we won&#8217;t use them in any project it&#8217;s a great way to strech our brains and think outside the box). On the other hand, this shift from a &#8220;standard&#8221; approach is a bit painful (and the infographics from the documentation do not help- at least in my case when I saw them for the first time 🙂).<br />
Either way- as with probably every new technology- a bit of pain and sweat and it becomes easier.<br />
Finally, answering the question (I know, I had to add a bit of storytelling 😏):</p>
<ul>
<li> a <strong>map</strong> function takes a <code>Function</code> as an argument </li>
<li> a <strong>flatMap</strong> takes a <code>Function&lt;T, Publisher&gt;</code>  </li>
</ul>
<p>In the example above-  the <code>articleRepository.update</code> function returns a Mono (which implements a Publisher), so we have to use the <code>flatMap</code>&#8211; otherwise we would end up with a <code>Mono&lt;Mono&lt;T&gt;&gt;</code> instead (just like flatMap in streams API flattens the structure and allows to avoid Stream&lt;Stream&gt; structure).<br />
And maybe I wouldn&#8217;t use the term &#8220;flatten&#8221; in terms of the Project Reactor, I believe this comparison is a good way to start with in the beginning and gradually learn other concepts, like subscriptions etc.</p>
<p>Hope this answer helps (and even I sweated a bit when trying to describe it)! 😁</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Eric		</title>
		<link>https://blog.codersee.com/reactive-rest-api-with-micronaut-and-mongodb/#comment-69</link>

		<dc:creator><![CDATA[Eric]]></dc:creator>
		<pubDate>Fri, 18 Nov 2022 13:48:54 +0000</pubDate>
		<guid isPermaLink="false">https://codersee.com/?p=5503861#comment-69</guid>

					<description><![CDATA[Another great one Piotr! It inspired me to pull up some info on Flux and Mono. I didn&#039;t see the point at first given Java streams, but I now see the reason for their existence and they are quite powerful and useful. I will spend more time mining the depths of their capability. QUESTION: why flatmap vs. just map usage for the update function, for example? That function (and the others) is quite elegant, but makes my brain hurt a little :)]]></description>
			<content:encoded><![CDATA[<p>Another great one Piotr! It inspired me to pull up some info on Flux and Mono. I didn&#8217;t see the point at first given Java streams, but I now see the reason for their existence and they are quite powerful and useful. I will spend more time mining the depths of their capability. QUESTION: why flatmap vs. just map usage for the update function, for example? That function (and the others) is quite elegant, but makes my brain hurt a little 🙂</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 

Served from: blog.codersee.com @ 2026-05-12 16:56:12 by W3 Total Cache
-->