What happened

For the third day in a row, shares of database software provider MongoDB (MDB 0.81%) got hit with a price target cut on Wall Street Friday, according to reports from StreetInsider.com.  

And yet, MongoDB stock was up 5.8% as of 10 a.m. ET today. 

Two techies working on a database on a tablet at a server farm.

Image source: Getty Images.

So what

Why is that? The first and most obvious answer is this: On Wednesday, Mizuho cut its price target on MongoDB to $270 per share. On Tuesday, Morgan Stanley followed with a cut to $378. And now, Barclays announced a cut to $330. But MongoDB stock only costs $257 and change, meaning that each of these price target cuts still presents MongoDB as an undervalued stock.

The arguments underlying the price cuts might also be helping shore up support for MongoDB today. On the one hand, Barclays says it's seeing decreased demand for business software in recent surveys, and Mizuho cites "macroeconomic uncertainty." On the other hand, though, even if we live in an uncertain world, and demand is relatively weaker than it once was, Mizuho says that software demand remains good overall.

Now what

That hardly seems like a reason to sell the stock. Now here's a reason you might consider buying MongoDB:

Reviewing the company's latest financials, it's clear that MongoDB is still not profitable, and when calculated according to generally accepted accounting principles (GAAP), it might not become profitable for many years to come. Data from S&P Global Market Intelligence shows that MongoDB has never earned a profit as a publicly traded company. Moreover, analysts who follow the stock don't foresee profits arriving before 2027.  

And yet, from one perspective, MongoDB is already on the cusp of cash profitability. Last year, for the first time ever, the company achieved positive operating cash flow, only barely exceeded by capital spending that kept its free cash flow in the red. If current trends hold true, I see the company turning free-cash-flow positive for the first time ever as early as this year. And by 2027 -- the year analysts say GAAP profitability will finally arrive -- MongoDB could already be generating as much as $800 million in positive cash profits annually.

Wall Street might be starting to lose patience with MongoDB today, but with free-cash-flow positivity finally on the horizon, 2022 looks like the wrong time to sell the stock.