mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-28 13:34:32 +08:00
Update mongodb
This commit is contained in:
parent
699aacae41
commit
8112da7fbf
@ -40,6 +40,17 @@ namespace MongoDb.Ado.data
|
|||||||
if (connStr.TrimStart().StartsWith("mongodb://", StringComparison.OrdinalIgnoreCase))
|
if (connStr.TrimStart().StartsWith("mongodb://", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
mongoConnStr = connStr;
|
mongoConnStr = connStr;
|
||||||
|
var mongoUrl = new MongoUrl(connStr);
|
||||||
|
if (!string.IsNullOrEmpty(mongoUrl.DatabaseName))
|
||||||
|
{
|
||||||
|
_databaseName = mongoUrl.DatabaseName;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_databaseName = "SqlSugarDefaultDB";
|
||||||
|
}
|
||||||
|
_client = GetOrCreateClient(mongoConnStr);
|
||||||
|
_database = _client.GetDatabase(_databaseName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user