Ser*_*dar 5 mongodb mongodb-.net-driver
我计划安装 mongodb 和连接到同一台机器的 Windows 服务。该机器将处于隔离网络中。
当我们这样做的时候。无密码连接本地mongodb可以吗?
我规划的房产是这样的...
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")); }
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1076 次 |
| 最近记录: |