Spring Data MongoDB - Reference Documentation

Authors

Mark Pollack, Thomas Risberg, Oliver Gierke, Costin Leau, Jon Brisbin, Thomas Darimont, Christoph Strobl

1.5.5.RELEASE

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.


Table of Contents

Preface
I. Introduction
1. Requirements
2. Additional Help Resources
2.1. Support
2.1.1. Community Forum
2.1.2. Professional Support
2.2. Following Development
3. Working with Spring Data Repositories
3.1. Core concepts
3.2. Query methods
3.2.1. Defining repository interfaces
Fine-tuning repository definition
3.2.2. Defining query methods
Query lookup strategies
Query creation
Property expressions
Special parameter handling
3.2.3. Creating repository instances
XML configuration
JavaConfig
Standalone usage
3.3. Custom implementations for Spring Data repositories
3.3.1. Adding custom behavior to single repositories
3.3.2. Adding custom behavior to all repositories
3.4. Spring Data extensions
3.4.1. Web support
Basic web support
Hypermedia support for Pageables
3.4.2. Repository populators
3.4.3. Legacy web support
Domain class web binding for Spring MVC
Web pagination
II. Reference Documentation
4. MongoDB support
4.1. Getting Started
4.2. Examples Repository
4.3. Connecting to MongoDB with Spring
4.3.1. Registering a Mongo instance using Java based metadata
4.3.2. Registering a Mongo instance using XML based metadata
4.3.3. The MongoDbFactory interface
4.3.4. Registering a MongoDbFactory instance using Java based metadata
4.3.5. Registering a MongoDbFactory instance using XML based metadata
4.4. General auditing configuration
4.5. Introduction to MongoTemplate
4.5. . Instantiating MongoTemplate
WriteResultChecking Policy
WriteConcern
WriteConcernResolver
4.6. Saving, Updating, and Removing Documents
4.6.1. How the '_id' field is handled in the mapping layer
4.6.2. Type mapping
4.6.3. Methods for saving and inserting documents
Which collection will my documents be saved into?
Inserting or saving individual objects
Inserting several objects in a batch
4.6.4. Updating documents in a collection
Methods for executing updates for documents
Methods for the Update class
4.6.5. Upserting documents in a collection
4.6.6. Finding and Upserting documents in a collection
4.6.7. Methods for removing documents
4.7. Querying Documents
4.7.1. Querying documents in a collection
Methods for the Criteria class
Methods for the Query class
4.7.2. Methods for querying for documents
4.7.3. GeoSpatial Queries
Geo near queries
4.8. Map-Reduce Operations
4.8.1. Example Usage
4.9. Group Operations
4.9.1. Example Usage
4.10. Aggregation Framework Support
4.10.1. Basic Concepts
4.10.2. Supported Aggregation Operations
4.10.3. Projection Expressions
Spring Expression Support in Projection Expressions
4.10.4. Aggregation Framework Examples
4.11. Overriding default mapping with custom converters
4.11.1. Saving using a registered Spring Converter
4.11.2. Reading using a Spring Converter
4.11.3. Registering Spring Converters with the MongoConverter
4.11.4. Converter disambiguation
4.12. Index and Collection management
4.12.1. Methods for creating an Index
4.12.2. Accessing index information
4.12.3. Methods for working with a Collection
4.13. Executing Commands
4.13.1. Methods for executing commands
4.14. Lifecycle Events
4.15. Exception Translation
4.16. Execution callbacks
4.17. GridFS support
5. MongoDB repositories
5.1. Introduction
5.2. Usage
5.3. Query methods
5.3.1. Repository delete queries
5.3.2. Geo-spatial repository queries
5.3.3. MongoDB JSON based query methods and field restriction
5.3.4. Type-safe Query methods
5.4. Miscellaneous
5.4.1. CDI Integration
6. Mapping
6.1. Convention based Mapping
6.1.1. How the '_id' field is handled in the mapping layer
6.2. Mapping Configuration
6.3. Metadata based Mapping
6.3.1. Mapping annotation overview
6.3.2. Customized Object Construction
6.3.3. Compound Indexes
6.3.4. Using DBRefs
6.3.5. Mapping Framework Events
6.3.6. Overriding Mapping with explicit Converters
7. Cross Store support
7.1. Cross Store Configuration
7.2. Writing the Cross Store Application
8. Logging support
8.1. MongoDB Log4j Configuration
9. JMX support
9.1. MongoDB JMX Configuration
III. Appendix
A. Namespace reference
A.1. The <repositories /> element
B. Repository query keywords
B.1. Supported query keywords