As the bear market lingers, many technology stocks have fallen victim to fair-weather investors -- with some stock prices falling despite companies performing admirably. Many cloud-native stocks have been among the hardest hit, particularly those that aren't yet profitable or those with high valuations.

Such is the case with MongoDB (MDB 0.81%). The company's flagship product, Atlas, offers a fully hosted, multi-cloud, database-as-a-service (DBaaS) solution. MongoDB also offers a free-to-download version of its state-of-the-art product, which offers limited functionality for new or interested customers.

When the company reported the results for its fiscal 2023 second quarter (ended July 31), its performance should have had investors dancing in the streets. Instead, Wall Street generated a collective shrug. Digging a little deeper reveals the one factor that may have given investors pause.

Consistently strong top-line growth

MongoDB delivered revenue of $303.7 million, up 53% year over year. The results were powered by subscription revenue of $291.6 million, up 52%, while services revenue of $12.1 million climbed 64%. At the same time, the company was able to expand its gross profit margin to 71.4%, up from 69% in the prior-year period. 

If investors had one qualm with the results, it was that MongoDB is awash in red ink. The company generated an adjusted net loss of $15.6 million, which was more than double the $7.7-million loss in the year-ago period. This resulted in an adjusted loss per share of $0.23.

To give those numbers context, analysts' consensus estimates were calling for revenue of $284.4 million and an adjusted loss per share of $0.28, so MongoDB cleared both bars with ease. 

Customers continued to migrate to Atlas, as revenue grew 73% year over year and now represents 64% of total revenue.

Helping fuel the results was MongoDB's robust customer growth. The company added 1,800 customers sequentially, bringing the total to 37,000, up 28% year over year. One notable development was that MongoDB added a record number of direct sales customers, which grew 50%. Furthermore, customers spending more than $100,000 in annual recurring revenue (ARR) climbed to 1,462, up 30%. Finally, existing customers continued to expand their relationship with MongoDB, with a net ARR expansion rate that was once again over 120%.

Management also updated MongoDB's full-year outlook in the wake of its robust performance. The company is now guiding for revenue in a range of $1.196 billion to $1.206 billion, which represents growth of 37% at the midpoint of its guidance and coming in just ahead of analysts' consensus estimates of $1.2 billion. 

Any concerns, once again, seem to lie with the company's bottom-line outlook. MongoDB is forecasting an adjusted loss per share in a range of $0.35 to $0.28, which is significantly worse than the loss of $0.21 expected by analysts. 

Is it time to buy the stock?

MongoDB stock sold off in the wake of its earnings release, down more than 16% in after-hours trading (as of this writing). Given the consistent customer additions and robust revenue growth, the lingering question is why MongoDB's losses continue to mount and whether the company can make the transition to profitability. As if to emphasize that point, MongoDB's operating loss jumped 58% year over year, driven by a 66% increase in sales and marketing and a 49% increase in research and development expenses.

On the conference call, in response to an analyst question, MongoDB execs said the company is working to "capitalize on the long-term opportunity." History has shown that the lifetime value of new customers far exceeds what the company is currently spending to acquire them, so MongoDB is willing to take a short-term hit to its profits and stock price in order to boost its future results.

Finally, MongoDB isn't cheap in terms of traditional valuation metrics and is currently selling for 14 times next year's sales -- when a reasonable price-to-sales ratio is between 1 and 2 -- so investors are clearly baking a lot of future growth into the cloud operator's current share price. However, given its consistent strong revenue and customer growth, a premium valuation is likely warranted. 

This brings us back to the seminal investing question: "Is it time to buy the stock?" The answer depends very much on who you are as an investor. If you're an investor that has no interest in a stock with extreme volatility and high valuation, MongoDB likely won't make the cut, no matter what its future potential is. On the other hand, for an investor that has a sufficient investing time horizon and is willing to accept a high valuation and some gut-wrenching volatility in exchange for explosive potential gains, MongoDB might be a good fit.

For my money, MongoDB is a buy.