What happened

Shares of MongoDB (MDB 1.96%) shot higher following a strong quarterly earnings announcement. The company's better-than-expected results and upbeat outlook drove the stock up 39.9% in June, according to S&P Global Market Intelligence.

So what

MongoDB is one of the high-growth tech darlings that exploded to an unsustainable valuation during the pandemic then dropped steeply as interest rates rose while growth slowed. Along with many other growth stocks, MongoDB has since exhibited volatility as investors make sense of a complicated macroeconomic environment.

Software engeineer seated at a desk, writing code on two different computer monitors.

Image source: Getty Images.

MongoDB leapt nearly 30% higher immediately after its quarterly earnings report. Revenue grew 29% year over year, driven by subscriptions. The company added more customers, and it also expanded relationships with existing subscribers. That revenue growth also translated to significantly lower net losses under generally accepted accounting principles (GAAP), along with a $43 million increase in quarterly free cash flow. Expense growth didn't keep up with sales, which is good for risk-averse investors.

The top line was about 7% higher than Wall Street's projections, and MongoDB's adjusted earnings smashed estimates. The company indicated that this was the start of a promising trend by revising its full-year guidance higher for both revenue and earnings. It also excited investors by addressing a substantial growth opportunity created by the proliferation of artificial intelligence. MongoDB offers cloud-native, developer-focused database tools, which are valuable products for many of the high-growth software products being built right now. AI has been a hot topic that tends to fuel rallies in the tech sector, so investors were predictably thrilled to hear MongoDB talk about its own growth catalysts related to that trend.

Now what

Despite mounting a fierce comeback in recent months, MongoDB shares are still well below the all-time high around $600. That's probably for the best, because it looks like the stock got a bit ahead of its skis during the pandemic. Its price-to-sales ratio shot above 45, which opened the door to huge downside risk for an unprofitable company that was experiencing slowing growth.

MDB PS Ratio Chart

MDB PS Ratio data by YCharts

Following the most recent surge, MongoDB's price-to-free-cash-flow ratio is around 150, and its price-to-sales ratio is still above 20. That's obviously much more reasonable than prior valuation levels, especially as the company looks forward to accelerating sales and improved cash profits. However, it's still quite expensive. Substantial future success is already assumed in this price. MongoDB has a chance to blossom into one of tomorrow's tech leaders, but growth investors should be prepared for significant potential volatility as that story comes to fruition.