MongoDB's net profit margin has been improving significantly over the last 5 years, increasing from -35% to +2%. This makes the P/E ratio not a very reliable lens to value the stock, vs using P/E ratios to compare mature companies that have relatively stable net profit margins.
To crudely estimate a fundamental valuation for MongoDB as a discounted sequence of future earnings, we'd need some understanding of the main factors that are driving this change in the net profit margin (over the next 5 years do we expect those factors to persist? to decay? to accelerate?), some modelling assumptions & forecasts for how they'll evolve over the next decade or two, and a discount factor.
Out of curiosity, I bashed together a naive NPV valuation, in complete ignorance of MongoDB's underlying business.
Completely unjustified modelling assumptions: suppose MongoDB can grow revenue at +20% / year for 5 years, then +5% / year for the next 5, then hitting a steady state +2.5% / year revenue growth; MongoDB grows net profit margin by +5% every year until hitting a 25% net profit margin, where it tops out; discount factor of 9.5% (= 5% risk free rate + 4.5% equity risk premium); no change in number of shares outstanding (perhaps optimistic, given they issued a bunch of stock within the last 5 years). Projecting this out 20 years & then using a 20x P/E valuation multiple at year 20 for the terminal value gives us an NPV estimate of the value at about $290 / share.
So if you believe MongoDB's business will do about that well, with your fundamental valuation investor hat on you could consider buying some stock if it were offered at, say, half the current market price or less -- assuming there isn't anything more attractive to invest in.
If you believe MongoDB's revenue growth & improvement in net profit margin will be much stronger over the next decade, maybe you'd be comfortable buying closer to the current market price.
(I don't hold any MongoDB stock & find it hard to stomach investing in growth companies vs companies that are more mature & easier to understand, but I appreciate that to value growth stocks you're not going to have much luck using P/B or P/E ratios)