Home » Tag Archives: MongoDB (page 2)

Tag Archives: MongoDB

Microservices Development with Scala, Spray, MongoDB, Docker and Ansible

scala-logo

This article tries to provide one possible approach to building microservices. We’ll use Scala as programming language. API will be RESTful JSON provided by Spray and Akka. MongoDB will be used as database. Once everything is done we’ll pack it all into a Docker container. Vagrant with Ansible will take care of our environment and configuration management needs. We’ll do ...

Read More »

How to create a pub/sub application with MongoDB ? Introduction

mongodb-logo

In this article we will see how to create a pub/sub application (messaging, chat, notification), and this fully based on MongoDB (without any message broker like RabbitMQ, JMS, … ). So, what needs to be done to achieve such thing: an application “publish” a message. In our case, we simply save a document into MongoDB another application, or thread, subscribe ...

Read More »

Creating a REST API with Spring Boot and MongoDB

mongodb-logo

Spring Boot is an opinionated framework that simplifies the development of Spring applications. It frees us from the slavery of complex configuration files and helps us to create standalone Spring applications that don’t need an external servlet container. This sounds almost too good to be true, but Spring Boot can really do all this. This blog post demonstrates how easy ...

Read More »

MongoDB Incremental Migration Scripts

mongodb-logo

Introduction An incremental software development process requires an incremental database migration strategy. I remember working on an enterprise application where the hibernate.hbm2ddl.auto was the default data migration tool. Updating the production environment required intensive preparation and the migration scripts were only created on-the-spot. An unforeseen error could have led production data corruption. Incremental updates to the rescue The incremental database ...

Read More »

Integration testing done right with Embedded MongoDB

mongodb-logo

Introduction Unit testing requires isolating individual components from their dependencies. Dependencies are replaced with mocks, which simulate certain use cases. This way, we can validate the in-test component behavior across various external context scenarios. Web components can be unit tested using mock business logic services. Services can be tested against mock data access repositories. But the data access layer is ...

Read More »

How to connect to MongoDB from a Java EE stateless application

mongodb-logo

In this post I will present how to connect to MongoDB from a stateless Java EE application, to take advantage of the built-in pool of connections to the database offered by the MongoDB Java Driver. This might be the case if you develop a REST API, that executes operations against a MongoDB. Get the Java MongoDb Driver To connect from Java to ...

Read More »

Introduction to MongoDB Geospatial feature

mongodb-logo

This post is a quick and simple introduction to Geospatial feature of MongoDB 2.6 using simple dataset and queries. Storing Geospatial Informations As you know you can store any type of data, but if you want to query them you need to use some coordinates, and create index on them. MongoDB supports three types of indexes for GeoSpatial queries:   ...

Read More »

Replica Set Members in Mongodb

mongodb-logo

In the previous articles we have discussed many aspects of replica set in mongodb. And in those articles we have talked many things about members. So, what are these members? What is their purpose? Let us discuss about these things in this article. What are members in mongodb? In short terms the members in mongodb are the mongod processes which ...

Read More »

How to Use Projection in MongoDB?

mongodb-logo

In mongodb, projection means selecting only necessary data rather than selecting the whole data of a document. If a document has 5 fields and you need to show only 3, then select only 3 fields from it. There are a few projection operators that mongodb provides and helps us reach that goal. Let us discuss about those operators in detail below. ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.