The bear market has been particularly brutal on tech stocks, especially those that are unprofitable and those with high valuations. MongoDB (MDB 3.88%) fell into both categories, and its punishment was swift and severe, with the stock shedding 74% of its value since late last year.

If investors had a holiday wish list related to MongoDB, it would undoubtedly include a beat and raise, strong growth, and maybe even a little profitability for their stocking. When the company released its financial results, MongoDB put plenty of presents under the tree, delivering everything on shareholders' wish lists -- and more.

A person clenching their fist in victory while looking at graphs on a computer.

Image source: Getty Images.

A holiday bounty

For its fiscal 2023 third quarter (ended Oct. 31), MongoDB generated total revenue of $333.6 million, up 47% year over year. The results were fueled by subscription revenue of $320.8 million, up 47%, while services revenue of $12.9 million climbed 43%. At the same time, the company was able to expand its gross profit margin to 72%, up from 70% in the year-ago period. 

Investors looking at the bottom line thought Christmas came early. After closing out the second quarter with a loss, the company generated an adjusted net income of $18.7 million, up more than sevenfold from $2.6 million in the prior-year period. This resulted in adjusted earnings per share of $0.23. 

To give those numbers context, analysts' consensus estimates were calling for revenue of $304.9 million and an adjusted loss per share of $0.17. MongoDB sailed past expectations, beating them by a wide margin. 

MongoDB continued to add customers to the company's fully hosted, multicloud, database-as-a-service solution -- Atlas -- which grew revenue by 61% year over year and now represents 63% of the company's total sales.

Helping power the results was MongoDB's solid customer growth. The company added 2,100 customers sequentially, bringing the total to 39,100, up 26% year over year. Perhaps more importantly, MongoDB's most valuable customers -- those spending more than $100,000 or more in annual recurring revenue (ARR) -- climbed to 1,545, up 29%. Finally, existing customers continue to spend more money with MongoDB, as evidenced by its net ARR expansion rate, which was once again above 120%. 

Management also increased MongoDB's full-year forecast in the wake of its robust performance. The company is now guiding for revenue in a range of $1.257 billion to $1.26 billion, which represents growth of 44% at the midpoint of its guidance, up from its previous forecast of 39% growth and coming in far ahead of analysts' consensus estimates of $1.2 billion. 

Is it too late to buy the stock?

MongoDB has been a great example of the volatility inherent in many mid-cap stocks. Just three months ago, the stock plunged 25% on the day following its second-quarter results. At the time, investors were firmly focused on the company's lack of profits as MongoDB swung from an adjusted profit to a loss. Furthermore, management had predicted further adjusted losses in the current quarter, but conditions improved and those failed to materialize.

By the time you read this, it's likely that MongoDB stock will have risen significantly from Tuesday's closing price of $144.69 per share. In fact, at the time of this writing, the stock is up more than 26% in premarket trading Wednesday morning, though it remains to be seen if that level will hold. This is in stark contrast to the stock's 25% decline after its Q2 earnings but helps illustrate an important point for potential investors: This stock is subject to gut-wrenching volatility, so let the buyer beware.

It's also worth noting that, even after its spectacular fall from grace, MongoDB isn't cheap in terms of traditional valuation metrics. The stock is currently trading for 6 times next year's sales when a reasonable price-to-sales ratio is between 1 and 2. However, investors have historically awarded a premium valuation to companies with a strong history of sales and customer growth, and MongoDB easily clears that bar. 

This brings us back to the question at hand: Is it too late to buy the stock? This answer will obviously depend upon your personal investing preferences. For those with no tolerance for volatility or stocks with frothy valuations, MongoDB probably won't make the grade. However, for investors with an appetite for a little risk in hopes of much greater rewards and the ability to withstand 25% stock price moves -- both up and down -- MongoDB might be a good fit for your investing style. It also helps if you have three to five years to wait while the investing thesis plays out.

That said, given its consistently high growth and potential for explosive profits down the road, in my book, MongoDB is an unqualified buy.