MANGODB ENVIRONMENT SETUP
MongoDB Environment Setup
• To get started with MongoDB, you have to install it in
your system. You need to find and download the latest
version of MongoDB, which will be compatible with
your computer system.
• You can use this
(http://www.mongodb.org/downloads) link and follow
the instruction to install MongoDB in your PC.
MongoDB Environment Setup
• The website of MongoDB provides all the installation
instructions, and MongoDB is supported by Windows.
• It is to be noted that, MongoDB will not run in
Windows XP; so you need to install higher versions of
windows to use this database.
MongoDB Environment Setup
• Once the download is complete, double click this setup file to install it. Follow
the steps:
MongoDB Environment Setup
• Follow the steps:
MongoDB Environment Setup
• Follow the steps:
MongoDB Environment Setup
• Follow the steps:
MongoDB Environment Setup
• Follow the steps:
• Once the installation is done completely, you need to start MongoDB and to
do so follow the process:
1. Open Command Prompt.
2. Type: C:\Program Files\MongoDB\Server\4.0\bin
3. Now type the command simply: mongod to run the server.
MongoDB Environment Setup
• Follow the steps:
• Once the installation is done completely, you need to start MongoDB and to
do so follow the process:
1. Open Command Prompt.
2. Type: C:\Program Files\MongoDB\Server\4.0\bin
3. Now type the command simply: mongod to run the server.
MongoDB Environment Setup
• For storing data in a MongoDB, you need to create a database
first.
• It will allow you to systematically organize your data so that it
can be retrieved as per requirement.
• If you wish to delete a database, MongoDB also allows you to
delete that.
• Todays lab, you will learn how to create and delete a database in
MongoDB.
CREATING A DB IN MONGODB
• For storing data in a MongoDB, you need to create a database
first.
• It will allow you to systematically organize your data so that it
can be retrieved as per requirement.
• If you wish to delete a database, MongoDB also allows you to
delete that.
• Todays lab, you will learn how to create and delete a database in
MongoDB.
CREATING A DB IN MONGODB
• For storing data in a MongoDB, you need to create a database
first.
• It will allow you to systematically organize your data so that it
can be retrieved as per requirement.
• If you wish to delete a database, MongoDB also allows you to
delete that.
• Todays lab, you will learn how to create and delete a database in
MongoDB.
CREATING A DB IN MONGODB
• In this MongoDB tool, you need not have to produce, or it
is optional to create a database manually.
• This is because MongoDB has the feature of automatically
creating it for the first time for you, once you save your
value in that collection.
• So, explicitly, you do not need to mention or put a
command to create a database; instead it will be created
automatically once the collection is filled with values.
CREATING A DB IN MONGODB
• You can make use of the "use" command followed by the
database_name for creating a database.
• This command will tell the MongoDB client to create a database
by this name if there is no database exists by this name.
• Otherwise, this command will return the existing database that
has the name.
• Syntax
• use my_project_db
CREATING A DB IN MONGODB
• You can make use of the "use" command followed by the
database_name for creating a database.
• This command will tell the MongoDB client to create a database
by this name if there is no database exists by this name.
• Otherwise, this command will return the existing database that
has the name.
• Syntaxuse my_project_db
CREATING A DB IN MONGODB
• You can make use of the "use" command followed by the
database_name for creating a database.
• This command will tell the MongoDB client to create a database
by this name if there is no database exists by this name.
• Otherwise, this command will return the existing database that
has the name.
• Syntaxuse my_project_db
CREATING A DB IN MONGODB
• You can make use of the "use" command followed by the
database_name for creating a database.
• This command will tell the MongoDB client to create a database
by this name if there is no database exists by this name.
• Otherwise, this command will return the existing database that
has the name.
• Syntaxuse my_project_db
CREATING A DB IN MONGODB
• You can make use of the "use" command followed by the
database_name for creating a database.
• This command will tell the MongoDB client to create a database
by this name if there is no database exists by this name.
• Otherwise, this command will return the existing database that
has the name.
• Syntaxuse my_project_db
CREATING A DB IN MONGODB
• You can make use of the "use" command followed by the
database_name for creating a database.
• This command will tell the MongoDB client to create a database
by this name if there is no database exists by this name.
• Otherwise, this command will return the existing database that
has the name.
• Syntaxuse my_project_db
CREATING A DB IN MONGODB
• In MongoDB, the dropDatabase command is implemented for a similar
purpose. This also helps in deleting the connected data files of that
database.
• For operating this command, you have to reside on the current
database.
CREATING A DB IN MONGODB
• In MongoDB, the dropDatabase command is implemented for a similar
purpose. This also helps in deleting the connected data files of that
database.
• For operating this command, you have to reside on the current
database.
MONGODB DATA TYPES
• Data type is an essential component of a language or script
that is used to define the type of data being used in framing
the database.
• It is important for you to know that MongoDB stores data
in BSON format.
• Today you will learn about the different data types that
exist in MongoDB, along with their implementation
techniques.
WHAT ARE JSON AND BSON?
• JSON based databases usually return query
results which can be effortlessly parsed, having
modest or nix transformation,
straightforwardly by the use of JavaScript along
with most well-liked programming languages -
dropping the quantity of logic one needs for
building your application layer.
WHAT ARE JSON AND BSON?
• In the case of MongoDB, data representation is done
in JSON document format, but here the JSON is
binary-encoded, which is termed as BSON.
• BSON is the extended version of the JSON model,
which is providing additional data types, makes
performance to be competent to encode and decode
in diverse languages and ordered fields.
DIFFERENT MONGO DB DATA TYPES
• Remote procedure calls in MongoDB can be made by using
the BSON format.
• MongoDB has a unique way of representing data types in
which each data type is associated with an alias as well as a
number that is usually used to search or find any specific
record within a MongoDB database.
• MongoDB allows its users to implement different
variations of data types:
DIFFERENT MONGO DB DATA TYPES
DIFFERENT MONGO DB DATA TYPES
DIFFERENT MONGO DB DATA TYPES
DIFFERENT MONGO DB DATA TYPES
DIFFERENT MONGO DB DATA TYPES
DIFFERENT MONGO DB DATA TYPES