I am planning to install mongodb and the windows service which is connecting to it to the same machine.
That machine will be in isolated network.
When we do it like that.
Is it ok to connect local mongodb passwordless?
My planned properties will be like this…
private MongoDatabase _db;
public MongoDatabase DB
{
get
{
if (_db == null)
{
var mongoServer = MongoServer.Create();
_db = mongoServer.GetDatabase("myStatistics");
}
return _db;
}
}
private MongoCollection _collection;
public MongoCollection Collection
{
get { return _collection ?? (_collection = DB.GetCollection("myStats")); }
}
There are two options:
It’s okay to use MongoDB with auth disabled in trusted network. MongoDb developers recommend running the database in trusted environment rather than focusing on auth options.