Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
MKCLOS
Core Development Platform
corepkgv2
Commits
74bf9537
Commit
74bf9537
authored
11 months ago
by
Somnath Ghorpade
Browse files
Options
Downloads
Patches
Plain Diff
Added find allowDiskUse options.
parent
5c31ae9e
Branches
SG_Findops
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dalmdl/coremongo/coremongo.go
+6
-3
dalmdl/coremongo/coremongo.go
with
6 additions
and
3 deletions
dalmdl/coremongo/coremongo.go
+
6
−
3
View file @
74bf9537
...
@@ -152,7 +152,7 @@ func InitNewSession(hostDetails MongoHost) error {
...
@@ -152,7 +152,7 @@ func InitNewSession(hostDetails MongoHost) error {
return
nil
return
nil
}
}
//GetMongoConnection method
//
GetMongoConnection method
func
GetMongoConnection
(
hostName
string
)
(
*
mongo
.
Client
,
error
)
{
func
GetMongoConnection
(
hostName
string
)
(
*
mongo
.
Client
,
error
)
{
mutex
.
Lock
()
mutex
.
Lock
()
defer
mutex
.
Unlock
()
defer
mutex
.
Unlock
()
...
@@ -359,7 +359,7 @@ func (mg *MongoDAO) DeleteAll(selector map[string]interface{}) error {
...
@@ -359,7 +359,7 @@ func (mg *MongoDAO) DeleteAll(selector map[string]interface{}) error {
return
deleteError
return
deleteError
}
}
//Set Find Options
//
Set Find Options
func
(
mg
*
MongoDAO
)
SetFindOps
(
findOps
map
[
string
]
interface
{})
{
func
(
mg
*
MongoDAO
)
SetFindOps
(
findOps
map
[
string
]
interface
{})
{
mg
.
MetaData
.
Findops
=
findOps
mg
.
MetaData
.
Findops
=
findOps
}
}
...
@@ -405,6 +405,9 @@ func (mg *MongoDAO) GetProjectedData(selector map[string]interface{}, projector
...
@@ -405,6 +405,9 @@ func (mg *MongoDAO) GetProjectedData(selector map[string]interface{}, projector
})
})
ops
.
SetSort
(
sort
)
ops
.
SetSort
(
sort
)
}
}
if
obj
.
Get
(
"allowDiskUse"
)
.
Value
()
!=
nil
{
ops
.
SetAllowDiskUse
(
obj
.
Get
(
"allowDiskUse"
)
.
Bool
())
}
}
}
ops
.
Projection
=
projector
ops
.
Projection
=
projector
cur
,
err
:=
collection
.
Find
(
context
.
Background
(),
selector
,
ops
)
cur
,
err
:=
collection
.
Find
(
context
.
Background
(),
selector
,
ops
)
...
@@ -551,7 +554,7 @@ func (mg *MongoDAO) PushData(selector map[string]interface{}, data interface{})
...
@@ -551,7 +554,7 @@ func (mg *MongoDAO) PushData(selector map[string]interface{}, data interface{})
return
nil
return
nil
}
}
//set update option for custom update
//
set update option for custom update
func
(
mg
*
MongoDAO
)
SetUpdateOps
(
updateOps
map
[
string
]
interface
{})
{
func
(
mg
*
MongoDAO
)
SetUpdateOps
(
updateOps
map
[
string
]
interface
{})
{
mg
.
MetaData
.
UpdateOps
=
updateOps
mg
.
MetaData
.
UpdateOps
=
updateOps
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets