Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
88ca24ce
Commit
88ca24ce
authored
Apr 21, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
2a93da36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
MongoHelper.cs
Mall/Mall.CacheManager/Base/MongoHelper.cs
+5
-1
No files found.
Mall/Mall.CacheManager/Base/MongoHelper.cs
View file @
88ca24ce
...
@@ -93,7 +93,7 @@ namespace Mall.CacheManager.Base
...
@@ -93,7 +93,7 @@ namespace Mall.CacheManager.Base
var
dbNames
=
client
.
ListDatabases
().
ToList
().
Select
(
db
=>
db
.
GetValue
(
"name"
).
AsString
);
var
dbNames
=
client
.
ListDatabases
().
ToList
().
Select
(
db
=>
db
.
GetValue
(
"name"
).
AsString
);
return
dbNames
.
Contains
(
this
.
MongoConfig
.
DatabaseName
);
return
dbNames
.
Contains
(
this
.
MongoConfig
.
DatabaseName
);
}
}
catch
(
Exception
ex
)
//如果连接的账号不能枚举出所有DB会报错,则默认为true
catch
//如果连接的账号不能枚举出所有DB会报错,则默认为true
{
{
return
true
;
return
true
;
}
}
...
@@ -268,6 +268,7 @@ namespace Mall.CacheManager.Base
...
@@ -268,6 +268,7 @@ namespace Mall.CacheManager.Base
/// <param name="col">集合</param>
/// <param name="col">集合</param>
/// <param name="indexFields">索引字段</param>
/// <param name="indexFields">索引字段</param>
/// <param name="options"></param>
/// <param name="options"></param>
[
Obsolete
]
private
void
CreateIndex
<
TDoc
>(
IMongoCollection
<
TDoc
>
col
,
string
[]
indexFields
,
CreateIndexOptions
options
=
null
)
private
void
CreateIndex
<
TDoc
>(
IMongoCollection
<
TDoc
>
col
,
string
[]
indexFields
,
CreateIndexOptions
options
=
null
)
{
{
if
(
indexFields
==
null
)
if
(
indexFields
==
null
)
...
@@ -297,6 +298,7 @@ namespace Mall.CacheManager.Base
...
@@ -297,6 +298,7 @@ namespace Mall.CacheManager.Base
/// <typeparam name="TDoc">泛型约束</typeparam>
/// <typeparam name="TDoc">泛型约束</typeparam>
/// <param name="indexFields">索引字段</param>
/// <param name="indexFields">索引字段</param>
/// <param name="options"></param>
/// <param name="options"></param>
[
Obsolete
]
public
void
CreateCollectionIndex
<
TDoc
>(
string
[]
indexFields
,
CreateIndexOptions
options
=
null
)
public
void
CreateCollectionIndex
<
TDoc
>(
string
[]
indexFields
,
CreateIndexOptions
options
=
null
)
{
{
CreateIndex
(
GetMongoCollection
<
TDoc
>(),
indexFields
,
options
);
CreateIndex
(
GetMongoCollection
<
TDoc
>(),
indexFields
,
options
);
...
@@ -308,6 +310,7 @@ namespace Mall.CacheManager.Base
...
@@ -308,6 +310,7 @@ namespace Mall.CacheManager.Base
/// <typeparam name="TDoc">泛型约束</typeparam>
/// <typeparam name="TDoc">泛型约束</typeparam>
/// <param name="indexFields">索引字段</param>
/// <param name="indexFields">索引字段</param>
/// <param name="options"></param>
/// <param name="options"></param>
[
Obsolete
]
public
void
CreateCollection
<
TDoc
>(
string
[]
indexFields
=
null
,
CreateIndexOptions
options
=
null
)
public
void
CreateCollection
<
TDoc
>(
string
[]
indexFields
=
null
,
CreateIndexOptions
options
=
null
)
{
{
this
.
Database
.
CreateCollection
(
this
.
MongoConfig
.
CollectionName
);
this
.
Database
.
CreateCollection
(
this
.
MongoConfig
.
CollectionName
);
...
@@ -473,6 +476,7 @@ namespace Mall.CacheManager.Base
...
@@ -473,6 +476,7 @@ namespace Mall.CacheManager.Base
/// 清空集合对象
/// 清空集合对象
/// </summary>
/// </summary>
/// <typeparam name="TDoc">泛型约束</typeparam>
/// <typeparam name="TDoc">泛型约束</typeparam>
[
Obsolete
]
public
void
ClearCollection
<
TDoc
>()
public
void
ClearCollection
<
TDoc
>()
{
{
var
colleciton
=
GetMongoCollection
<
TDoc
>();
var
colleciton
=
GetMongoCollection
<
TDoc
>();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment