After more than 18 months of misery, it appears the bear market that plagued technology stocks may finally be over. The tech-centric Nasdaq Composite is now down just 18% from its peak, and if it continues along its current trajectory, the worst could be behind us.

Like many stocks, MongoDB (MDB -2.41%) was punished harshly, at one point losing more than two-thirds of its value. Yet, the cloud-native database specialist continued to crank out quarter after quarter of double-digit growth, and it appears the stock is now on the road to recovery.

After the market close on Thursday, MongoDB delivered decisive results, putting investors on notice that a rebound was at hand -- characterized by strength in all the metrics that matter and a classic beat-and-raise.

A person reviewing graphs on a computer monitor.

Image source: Getty Images.

A stunning performance

For its fiscal 2024 first quarter (ended April 30), MongoDB generated total revenue of $368.3 million, up 29% year over year. The results were fueled by subscription revenue of $354.7 million, also up 29%, while services revenue -- which tends to be lumpy -- climbed to $13.6 million, up 25%. At the same time, the company expanded its gross profit margin to 74%, up from 73% in the year-ago period. 

Profits were even more robust, with an adjusted net income of $45.3 million, nearly triple the $15.2 million it delivered in the year-ago period. This resulted in adjusted earnings per share (EPS) of $0.56, which soared 180%.

To give those numbers context, analysts' consensus estimates were calling for revenue of $347.8 million and adjusted EPS of $0.18, so MongoDB crushed expectations, beating them by a country mile. 

The company's database-as-a-service solution, Atlas, increased sales by 40% year over year and now represents 65% of MongoDB's total revenue.

Helping fuel the better-than-expected results was the company's surprisingly robust customer growth. MongoDB added 2,300 customers during the quarter -- the most in more than two years -- bringing the total to 43,100, up 5% sequentially and 22% year over year. More importantly, the number of MongoDB's most valuable customers -- those contributing more than $100,000 to annual recurring revenue (ARR) -- grew even faster, climbing to 1,761, a 28% increase. 

Not only that, the company is generating strong operating and free cash flow, edging closer to generally accepted accounting principles (GAAP) profitability with each passing quarter.

MongoDB also increased its full-year forecast in light of its strong performance. The company is now guiding for revenue in a range of $1.522 billion to $1.542 billion, which would represent 19% growth at the midpoint of its guidance. This was easily ahead of analysts' consensus estimates of $1.5 billion. 

Time to buy?

By the time you read this, MongoDB stock will likely have climbed significantly compared to Thursday's closing price of $293.96. In fact, as of this writing, the stock is up more than 23% in after-hours trading, though we'll have to wait to see what happens after the market opens. It's worth noting that MongoDB has already gained 50% in 2023 ahead of its earnings results, so plenty of growth was already baked in.

It's also worth noting that, after its recent run-up, MongoDB isn't cheap in terms of traditional valuation metrics. The stock is currently trading for 11 times next year's sales, when a reasonable price-to-sales ratio is between 1 and 2. However, valuation shouldn't be considered in a vacuum, and investors frequently award a premium valuation to companies with a strong history of revenue and customer growth -- and MongoDB checks both boxes. 

This brings us back to the quintessential investing question: "Is it time to buy the stock?"

As with so many things, the answer is, "It depends." Personal investing preferences will likely factor into the decision. As we have seen in recent years, MongoDB is -- and will probably continue to be -- volatile, regularly experiencing single-day stock price moves of 20% or more. Investors with no stomach for a pricey valuation or volatility will be better served looking elsewhere. Those willing to endure a bit more risk in return for the potential for greater rewards might consider MongoDB a good fit.

That said, given its consistent growth and potential for strong profits in the coming years, in my opinion, MongoDB is a solid, long-term buy.