How To Create Mongo Database

Posted by in Articles, Programming

Mongo database is a specific model that consists of a collection containing documents that are stored in the form of key value. Here is step by step tutorial with images , that explains how to create mongo database.
Below is a typical structure of the mongo collection :

_id: 1234,
Author: { name: "Ivan Blazevic", email : "" },
post: "how to create mongo database …",
date: { $date: "2013-09-3 13:23UTC" },
comments: [
korisnik: "",
text: "nice post!" },
{ user: "",
text: "cool!" }
tags: [ "tutorials", "internet" ]

To install mongo database follow instructions from
Run Command prompt as Administrator and navigate with comand “cd” to directory mongodb/bin . Execute from the Command Prompt mongod.exe


mongod baza

Connect to MongoDB using the mongo.exe shell. Open another Command Prompt and issue the following command:


To create database called blog with collection post. Type:

use blog

mongodb use blog

After that type :
_id: 1234,
Author: { Name: "Ivan Blazevic", email : "" },

This will create database blog with collection post , that has attributes _id,Author. You can see your created data with the command :

mongo create database