What are the main benefits of using MongoDB in web apps?

Geospatial queries are built in. No more relying on third parties for this stuff, unless you have really specific needs, or need to be ultra-accurate. That said, there's things about Mongo that are nice, but have more to do with the contrast between relational databases and document stores than with Mongo itself.

* It's a really nice bridge between SQL and NoSQL. Mongo, especially when using an ORM, has a lot of features that are similar to relational databases, and so it's an easy way to get your feet wet with document stores.
* It maps really nicely to most dynamic languages. Since it understands arrays and hashes natively, it almost feels like an object database when used with Ruby.
* MapReduce has a nice interface. Their javascript implementation is much cleaner than other NoSQL stores.
* It's freaking fast.
* Atomic operations let you do some things that would need a transaction in a relational database.
* Geospatial queries are built in. No more relying on third parties for this stuff, unless you have really specific needs, or need to be ultra-accurate.

That said, there's things about Mongo that are nice, but have more to do with the contrast between relational databases and document stores than with Mongo itself:

* Document modeling fits certain use-cases really well. I'm still exploring particular ones, but having embedded comments on some sort of domain model is one that's been spectacular for me.
* Document modeling can drastically reduce your queries per page. I have an app that only needs two queries on most pages, because of the 'denormalization'.
* Due to the schema-less nature of document stores, it's much faster to get up and running, and to change the way you store your data.

There are also some drawbacks:

* Don't even bother using 32 bit. You have a 2G database size limit there.
* It's fast because by default it only pages stuff out to disk once per second, so you could theoretically lose data.
* It's also fast because with certain settings it actually returns before it knows if the write fails or not, this may or may not be what you want.

Bottom line: Know your tools. use the best one.