<p>In this tutorial we will look about some examples of <b>Spring Data &#8211; MongoDB</b> integration. How to Spring configure with NoSQL database and what the advantages of this we will explain in this chapter.</p>
<p><b>Getting started with MongoDB and Spring Data </b>&#8211;<br />
The primary goal of the <a href="http://www.springsource.org/spring-data" target="_blank">Spring Data</a> project is to make it easier for developers to work with (No)SQL databases. The Spring Data project already has support for a number of ; NoSQL type of databases.</p>
<p><b>Spring Data for MongoDB </b>is part of the umbrella Spring Data project which aims to provide a familiar and consistent Spring-based programming model for for new datastores while retaining store-specific features and capabilities. 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.</p>
<h1 class="title" id="main-page-title">Spring Data</h1>
<p>
Spring Data makes it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services as well as provide improved support for relational database technologies.<br />
Spring Data is an umbrella open source project which contains many subprojects that are specific to a given database. The projects are developed by working together with many of the companies and developers that are behind these exciting technologies.</p>
<h1>Features</h1>
<ul>
<li>Spring configuration support using Java based @Configuration classes or an XML namespace for a Mongo driver instance and replica sets.</li>
<li>MongoTemplate helper class that increases productivity performing common Mongo operations. Includes integrated object mapping between documents and POJOs.</li>
<li>Exception translation into Spring&#8217;s portable Data Access Exception hierarchy</li>
<li>Feature Rich Object Mapping integrated with Spring&#8217;s Conversion Service</li>
<li>Annotation based mapping metadata but extensible to support other metadata formats</li>
<li>Persistence and mapping lifecycle events</li>
<li>Low-level mapping using MongoReader/MongoWriter abstractions</li>
<li>Java based Query, Criteria, and Update DSLs</li>
<li>Automatic implementation of Repository interfaces including support for custom finder methods.</li>
<li>QueryDSL integration to support type-safe queries.</li>
<li>Cross-store persistance &#8211; support for JPA Entities with fields transparently persisted/retrieved using MongoDB</li>
<li>Log4j log appender</li>
<li>GeoSpatial integration</li>
<li>Map-Reduce integration</li>
<li>JMX administration and monitoring</li>
<li>CDI support for repositories</li>
<li>GridFS support</li>
</ul>
<p>
There are below the list of Spring Data and MongoDB examples. Spring Data for MongoDB examples to perform insert, update, query and delete documents from MongoDB.</p>
<p><b>1. <a href="https://dineshonjava.com/2013/01/spring-data-mongodb-hello-world-example.html">Spring Data MongoDB hello world example</a></b><br />
Configure (both XML and annotation) and perform CRUD operations with “Spring Data for MongoDB” framework.</p>
<p><b>2. <a href="https://dineshonjava.com/2013/01/spring-data-mongodb-insert-document.html">Spring Data MongoDB : Insert document</a></b><br />
Example to use Spring data save(), insert() and insertList() to save domain object into mongoDB database.</p>
<p><b>3. <a href="https://dineshonjava.com/2013/01/spring-data-mongodb-update-document.html">Spring Data MongoDB : Update document</a></b><br />
Example to use Spring data save(), updateFirst() and updateMulti() to update existing domain object from mongoDB database.</p>
<p><b>4. <a href="https://dineshonjava.com/2013/02/spring-data-mongodb-query-document.html">Spring Data MongoDB : Query document</a></b><br />
Example to use Spring data findOne(), find() and getCollection() to get / query documents from mongoDB.</p>
<p><b>5. <a href="https://dineshonjava.com/2013/02/spring-data-mongodb-delete-document.html">Spring Data MongoDB : Delete document</a></b><br />
Example to remove() and findAndRemove() to delete document from mongoDB.</p>
<p>
<b>References</b></p>
<ol>
<li><b><a href="http://www.mongodb.org/" target="_blank">MongoDB official site</a></b></li>
<li><b><a href="http://www.mongodb.org/display/DOCS/Java+Tutorial" target="_blank">Java MongoDB official tutorials</a></b></li>
<li><b><a href="http://www.slideshare.net/scotthernandez/mongo-seattle-java-development" target="_blank">Java development with MongoDB</a></b></li>
<li><b><a href="http://www.springsource.org/spring-data/mongodb" target="_blank">Spring data for MongoDB</a></b></li>
<li><b><a href="http://static.springsource.org/spring-data/data-document/docs/1.0.0.M2/reference/html/#reference" target="_blank">Spring data for MongoDB documentation</a> </b></li>
</ol>
<p></p>
<div class="wp-post-navigation"> 
									 <div class="wp-post-navigation-pre"> 
									 <a href="https://dineshonjava.com/java-mongodb-convert-json-data-to/">Previous</a> 
									 </div> 
									 <div class="wp-post-navigation-next"> 
									 <a href="https://dineshonjava.com/authentication-to-mongodb-with-java/">Next</a> 
									 </div> 
									</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
 $.post('https://dineshonjava.com/wp-admin/admin-ajax.php', {action: 'mts_view_count', id: '586'});
});
</script>
Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…
Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…
Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…
Technology has emerged a lot in the last decade, and now we have artificial intelligence;…
Managing a database is becoming increasingly complex now due to the vast amount of data…
Overview In this article, we will explore Spring Scheduler how we could use it by…