close

Spring Data MongoDB

3.1.1

Spring Data for MongoDB is part of the umbrella Spring Data project which aims to provide a familiar and consistent Spring-based programming model for new datastores while retaining store-specific features and capabilities.

Introduction

The Spring Data MongoDB project provides integration with the MongoDB document database. Key functional areas of Spring Data MongoDB are a POJO centric model for interacting with a MongoDB DBCollection and easily writing a Repository style data access layer.

Features

  • Spring configuration support using Java based @Configuration classes or an XML namespace for a Mongo driver instance and replica sets.

  • MongoTemplate helper class that increases productivity performing common Mongo operations. Includes integrated object mapping between documents and POJOs.

  • Exception translation into Spring’s portable Data Access Exception hierarchy

  • Feature Rich Object Mapping integrated with Spring’s Conversion Service

  • Annotation based mapping metadata but extensible to support other metadata formats

  • Persistence and mapping lifecycle events

  • Low-level mapping using MongoReader/MongoWriter abstractions

  • Java based Query, Criteria, and Update DSLs

  • Automatic implementation of Repository interfaces including support for custom query methods.

  • QueryDSL integration to support type-safe queries. GeoSpatial integration

  • Map-Reduce integration

  • JMX administration and monitoring

  • CDI support for repositories

  • GridFS support

Spring Boot Config

Spring Initializr

Quickstart Your Project

Bootstrap your application with Spring Initializr.

Documentation

Each Spring project has its own; it explains in great details how you can use project features and what you can achieve with them.
3.1.1 CURRENT GA Reference Doc. API Doc.
3.2.0-SNAPSHOT SNAPSHOT
3.1.2-SNAPSHOT SNAPSHOT
3.0.6.BUILD-SNAPSHOT SNAPSHOT
3.0.5.RELEASE GA Reference Doc. API Doc.
2.2.12.BUILD-SNAPSHOT SNAPSHOT
2.2.11.RELEASE GA Reference Doc. API Doc.

A few examples to try out: