Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Spring Application Development

You're reading from   Mastering Spring Application Development Gain expertise in developing and caching your applications running on the JVM with Spring

Arrow left icon
Product type Paperback
Published in May 2015
Publisher
ISBN-13 9781783987320
Length 288 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Anjana Mankale Anjana Mankale
Author Profile Icon Anjana Mankale
Anjana Mankale
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Spring Mongo Integration 2. Messaging with Spring JMS FREE CHAPTER 3. Mailing with Spring Mail 4. Jobs with Spring Batch 5. Spring Integration with FTP 6. Spring Integration with HTTP 7. Spring with Hadoop 8. Spring with OSGI 9. Bootstrap your Application with Spring Boot 10. Spring Cache 11. Spring with Thymeleaf Integration 12. Spring with Web Service Integration Index

Chapter 1. Spring Mongo Integration

MongoDB is a popular NoSQL database and is a document-based one too. It is written using the popular and powerful C++ language, which makes it a document-oriented database. Queries are also document-based, and it also provides indexing using JSON style to store and retrieve data. MongoDB works on the concept of collection and documentation.

Let's look at few terminology differences between MySQL and MongoDB:

MySQL

MongoDB

Table

Collection

Row

Document

Column

Field

Joins

Embedded documents linking

In MongoDB, a collection is a set or a group of documents. It is the same as RDBMS tables.

In this chapter, we shall start by setting up a MongoDB NoSQL database and will integrate a spring application with MongoDB to perform CRUD operations. The first example demonstrates updating single document values. The second example considers an order use case where it requires two document references to be stored in the collection. It demonstrates the flexibility in referencing different documents of MongoDB using objectId references.

We need to go for a NoSQL database only if the applications have heavy write operations. MongoDB also suits the cloud environment very well, where we can take copies of databases easily.

In the next section, we shall see how we can get started with MongoDB, beginning with installing it, using the Spring Framework, and integrating MongoDB. To get started, we shall show basic Create, Retrieve, Update, and Delete (CRUD) operations with various use cases.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image