I have created an ASP.NET MVC 5 application, and I am hosting it on IIS 7. I would now like to start using a MongoDB database with this application. I have managed to get a MongoDB Windows Service running, but I am now stuck as to what the next step is.
Namely:
i) How do I specify in my ASP.NET MVC application what the name of the database is, and the directory where it is stored?
ii) How do I create this database in MongoDB?
In my Web.config file, I have the following lines:
<connectionStrings>
<add name="Mongo" connectionString="mongodb://localhost" />
</connectionStrings>
and:
<appSettings>
<add key="DbName" value="mydb" />
<add key="MONGOHQ_URL" value="mongodb://localhost" />
</appSettings>
So how do I now go about creating a database called mydb such that it is running in the MongoDB Windows Service?