[[mongodb.core]]
= MongoDB Support
:page-section-summary-toc: 1

Spring Data support for MongoDB contains a wide range of features:

* xref:mongodb/template-config.adoc[Spring configuration support] with Java-based `@Configuration` classes or an XML namespace for a Mongo driver instance and replica sets.
* xref:mongodb/template-api.adoc[`MongoTemplate` helper class] that increases productivity when performing common Mongo operations.
Includes integrated object mapping between documents and POJOs.
* xref:mongodb/template-api.adoc#mongo-template.exception-translation[Exception translation] into Spring's portable Data Access Exception hierarchy.
* Feature-rich xref:mongodb/mapping/mapping.adoc[Object Mapping] integrated with Spring's Conversion Service.
* xref:mongodb/mapping/mapping.adoc#mapping-usage-annotations[Annotation-based mapping metadata] that is extensible to support other metadata formats.
* xref:mongodb/lifecycle-events.adoc[Persistence and mapping lifecycle events].
* xref:mongodb/template-query-operations.adoc[Java-based Query, Criteria, and Update DSLs].
* Automatic implementation of xref:repositories.adoc[Repository interfaces], including support for custom query methods.
* xref:repositories/core-extensions.adoc#mongodb.repositories.queries.type-safe[QueryDSL integration] to support type-safe queries.
* xref:mongodb/client-session-transactions.adoc[Multi-Document Transactions].
* xref:mongodb/template-query-operations.adoc#mongo.geo-json[GeoSpatial integration].
* xref:mongodb/mongo-search-indexes.adoc#mongo.search.vector[Vector Index] and declarative xref:mongodb/repositories/vector-search.adoc[Vector Search] support.
* xref:mongodb/aot.adoc[Ahead Of Time (AOT)] optimizations.

For most tasks, you should use `MongoTemplate` or the Repository support, which both leverage the rich mapping functionality.
`MongoTemplate` is the place to look for accessing functionality such as incrementing counters or ad-hoc CRUD operations.
`MongoTemplate` also provides callback methods so that it is easy for you to get the low-level API artifacts, such as `com.mongodb.client.MongoDatabase`, to communicate directly with MongoDB.
The goal with naming conventions on various API artifacts is to copy those in the base MongoDB Java driver so you can easily map your existing knowledge onto the Spring APIs.
