I want to add an option to save data locally in my application using the mongo databse tools, I want to configure all the server information from within my application. I have 2 questions.
- the following code is working only after manual setup of mongodb localhost database in this way:
but on A computer that didn't configure the database setting, the code will not work. my code is :
public void createDB()
{
MongoClient client = new MongoClient();
var db = client.GetDatabase("TVDB");
var coll = db.GetCollection<Media>("Movies");
Media video = new Media("", "");
video.Name = "split";
coll.InsertOne(video);
}
this code works only after manual set the database like the picture above. without it I get in the last line A timeout exception. how can I configure it from my application to make it work (define Server) ?
- Is the user will be must install MongoDB software on his PC, or the API Package is enough in order to use the database? Many Thanks!