What happened

Shares of MongoDB (MDB -2.85%) charged sharply higher Friday, surging as much as 35.4%. As of 10:57 a.m. ET, the stock was up 30.7%.

The catalyst that drove the database-as-a-service provider higher was its quarterly financial results, which soared past even the most bullish expectations.

So what

For its fiscal 2024 first quarter (ended April 30), MongoDB delivered revenue of $368.3 million, up 29% year over year, signaling to investors that the worst may have passed. At the same time, the company delivered adjusted earnings per share (EPS) of $0.56, surging 180%. 

To give those numbers perspective, analysts' consensus estimates were calling revenue of $347.8 million and adjusted EPS of $0.18, so MongoDB sailed past expectations. 

Further fueling investor enthusiasm were the company's robust customer acquisitions. MongoDB added 2,300 net new customers, up 22% year over year -- the most in more than two years.

The company also continues to generate plenty of cash, with operating cash flow of $53.7 million and free cash flow of $51.8 million.

Now what

MongoDB gave investors other reasons to celebrate, as the company raised its full-year forecast as well. Management is now guiding for revenue of $1.532 billion, or roughly 19% growth at the midpoint of its guidance. For context, analysts were calling for full fiscal 2024 revenue of $1.5 billion. The company is also ramping up profitability and is now expecting EPS of $1.49 at the midpoint of its guidance, up from its forecast of $1.03 just three months ago. 

Management also noted the company is well positioned to benefit from the rise of artificial intelligence (AI). "We are observing an emerging trend where customers are increasingly choosing Atlas as a platform to build and run new AI applications," said CEO Dev Ittycheria. "For example, in Q1, more than 200 of the new Atlas customers were AI or [machine learning] companies." 

Atlas is MongoDB's fully managed cloud database.

The stock isn't cheap using traditional valuation metrics, currently selling for 15 times next year's sales, when a reasonable price-to-sales ratio is between 1 and 2. Investors have likely concluded that, given its continued strong performance, MongoDB is deserving of a premium valuation.

The company's "beat-and-raise" -- surpassing analysts' expectations and boosting guidance -- combined with increasing profitability and the opportunity presented by AI shows why MongoDB stock is a buy.