With the stock market still down significantly off its highs from earlier this year, there are still a lot of attractive stocks that you could buy. But with a limited amount of money available to invest, you have to be very picky. Many investors don't have enough cash to scoop up shares of 20 or 30 different stocks.

The good news is that you don't have to have a huge cash stockpile and you don't have to buy a lot of stocks in one fell swoop. Here are three great stocks to buy even if you have less than $5,000 to invest.

Two men holding giant jigsaw puzzle pieces, one with a light bulb drawn on it and the other with an equal sign and a dollar sign

Image source: Getty Images.

1. Alphabet

Sure, Alphabet's (NASDAQ:GOOG) (NASDAQ:GOOGL) share price stands at a little under $1,300 right now. But it's no problem at all if you're only able to buy one or two shares of Alphabet. You'll get a lot with your investment

Alphabet is known for its enormously popular apps and websites, including Google Search, YouTube, and Gmail. The company's Android operating system also powers nearly 87% of all smartphones, according to market researcher IDC. However, there's a lot more to Alphabet than these products that many Americans use everyday.

The company's Google Cloud business, which provides cloud hosting services to organizations, is growing rapidly. Although Google Cloud still trails well behind the two biggest players in the cloud market, Amazon.com and Microsoft, Alphabet has its target set on at least claiming the No. 2 spot in the future.

Alphabet's Waymo unit is the leader in self-driving car technology and should become a huge moneymaker over time. The company also could emerge as an important player in healthcare, with Verily teaming up with big partners to use data to tackle healthcare issues and Calico working on extending the human life span. Few companies claim the wide array of growth opportunities along with a strong moat for its existing businesses that Alphabet does.

2. Berkshire Hathaway

Berkshire Hathaway (NYSE:BRK.A) (NYSE:BRK.B) could serve as the poster child for getting a lot with your investment. Warren Buffett's company owns close to 60 businesses spanning a wide range of industries, including Dairy Queen, GEICO, Fruit of the Loom, and Precision Castparts.

The big conglomerate also has a huge investment portfolio. Berkshire owns stakes in over 40 stocks representing the airline, auto, banking, consumer goods, energy, healthcare, and technology sectors. Buying Berkshire Hathaway stock is almost like buying an exchange-traded fund (ETF).

There are two classes of Berkshire Hathaway shares -- class A and class B. If you have less than $5,000 to invest, you can forget about the class A shares. One Berkshire class A share currently trades for close to $285,000. However, Berkshire class B shares are much more affordable at less than $200 per share.

What I like the most about Berkshire is that the company has a lot of cash to use in buying stocks at attractive prices. Warren Buffett views market downturns as opportunities instead of problems. I expect that when Berkshire's next regulatory filing disclosing its holdings is submitted, we'll see plenty of purchases that could lead to market-beating returns over the next few years.

3. MongoDB

Now for a twist. MongoDB (NASDAQ:MDB) isn't nearly as well-known as Alphabet or Berkshire Hathaway. The database company is only a fraction of the sizes of those two giants. But MongoDB's smallness when compared to its market opportunity makes the stock very appealing, in my view.

IDC projects that the global database market will reach $97 billion by 2023, up from $71 billion this year. MongoDB currently claims only a sliver of that market -- a market share of less than 1%. However, the company's market share is growing faster than its much larger rivals.

One reason why MongoDB's growth rate tops its bigger competitors is that the company designed its database from the ground up to handle unstructured data. The market-leading databases were originally developed decades ago when data could be stored neatly into rows and columns. Today's world, with images, videos, and unstructured text, can't be handled as effectively with the approaches of the past. That gives MongoDB a solid competitive advantage.

In addition, MongoDB built its database to be run from anywhere, including the cloud. The company's primary growth driver is its Atlas cloud-based database-as-a-service platform, which makes it easy for customers to manage and store data in the cloud. As more organizations move their apps and data to cloud environments, I expect MongoDB's market share will grow much larger. Buying this small growth stock now should pay off in a big way over the long run.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.