How to query documents – WHERE, AND, OR, IN conditions in MongoDB

MongoDB is one of the most popular NoSQL database where data are stored in the form of documents. You can also create tables in traditional way to put your structured data but the main purpose is to store unstructured data in the form of object which may vary based on a particular requirement. Now when you select data from collection, you may not need all data to be fetched from the database collection and you want to restrict those data based on certain criteria or conditions while fetching from database.…

Continue

How to make output of MongoDB’s find() readable in shell

MongoDB is one of the most popular NoSQL database where your data are stored in a collection. To quickly access your data from MongoDB you can execute commands on MongoDB shell and your results appear based on the given criteria. One of the commands is find() function and using this command you can easily retrieve data from MongoDB collection. When you execute this find() command to retrieve data from a collection, it displays data in one line which makes it ugly and become difficult to read specially when there multiple…

Continue

How to pretty print JSON in Java

Here I am going to show you how to pretty print JSON in Java. I am going to use here JSON, Jackson and Google Gson library to prettify the JSON. I am also going to show you how to read and write JSON file using Java 8 or later version. I am going to show you how to prettify JSON string as well as JSON file data. Why do you need to prettify the JSON data? Because you want to read this JSON data manually when you received this data…

Continue

How to load local JSON File in Angular Application

JSON, i.e., JavaScript Object Notation is a lightweight format for interchanging data. It is based on a subset of JavaScript language. For example, this JSON data format is used in the webservice response. In old days webservices used XML for the primary data format but nowadays JSON, being lightweight, is becoming the preferred data format for exchanging data for most of the webservices. JSON is built on two structures: A collection of name/value pairs. In various languages, the JSON structure is realized as an object, record, struct, dictionary, hash table,…

Continue

How to merge two separate branches using Tortoise Git client

Here I am going to show you how to merge two separate branches into one using tortoise git client. Generally you or development team need to maintain separate line of development in different branches. So at some later point of time you need to merge your changes into another branch. Your team may manage different branches, such as feature branch for developing your features and changes are committed into feature branch and finally merged each feature branch into development branch and development branch to master branch that is generally remain…

Continue

How to clone and create remote Git repository branches using Tortoise Git

Here I will discuss on how to clone and create branch using tortoise git client. I assume here that a master branch already exists in the remote git repository. I will show you here how to clone the master repository in your local system using git client. You can also use the command line tool to clone the remote repository in your local system. Once cloning is done then I will show you how to create a development branch and a feature branch. For this example, I have a master…

Continue

Docker Compose – Dockerizing Django MySQL App

In this tutorial I will show you how to dockerize Django MySQL app using docker compose in Linux environment. So why do you need docker compose when you have docker container? Generally it is said to be best practices when each docker container runs a process with single responsibility, but for this application you need two containers – one is for Django app and another one is for MySQL server. Therefore two containers are running independently and to establish communication between two containers you need docker compose.

Continue

How to generate PDF report from MySQL database in Spring Boot

I am going to show yo how to download PDF file from MySQL database using Spring Boot and iText library in Java programming language. Many applications require dynamic generation of PDF documents for reporting purpose, such as, generating statements for customers, readers buying online specific chapters of a book, etc. In my another tutorial I had shown how to create or write to a PDF file using Java based iText library. The iText library is freely available and can be used using maven or gradle build tool. We can also…

Continue

How to generate Excel Report from MySQL Database in Spring Boot

Here I am going to show you how to download excel file from MySQL using Spring framework. Generating excel report from MySQL database has few advantages over other file formats. Most of the people you are working with in your organization are familiar with excel file format, hence it needs a short learning curve. You may also like to read how to download json file in Spring Boot. The excel file has other benefits as given below: It allows you to use templates and formulas to aggregate data. It has…

Continue