MongoDB - creation of a database

Professionaluser
Posted by Professionaluser under Sql Server category on | Points: 40 | Views : 1103
In MongoDB, the syntax is something different from SQL Server....

use DatabaseName command is used to create a new database(with name <DatabaseName>) in MongoDB whereas SQL Server uses same command to change the database context to the specified database or database snapshot.

In MongoDB command prompt, type the below command
>use TestDatabase


creates new database with name TestDatabase if it doesn't exist, otherwise it will return the existing database.

Comments or Responses

Login to post response