private accessor

This commit is contained in:
mr
2024-07-31 10:35:03 +02:00
parent 7ae1399a9a
commit 00fe19083b
10 changed files with 49 additions and 36 deletions

View File

@@ -57,9 +57,12 @@ func (wfa workflowExecutionMongoAccessor) LoadAll() ([]utils.ShallowDBObject, in
return objs, 200, nil
}
func (wfa *workflowExecutionMongoAccessor) Search(word string) ([]utils.ShallowDBObject, int, error) {
func (wfa *workflowExecutionMongoAccessor) Search(word string, options ...string) ([]utils.ShallowDBObject, int, error) {
objs := []utils.ShallowDBObject{}
res_mongo, code, err := mongo.MONGOService.Search(word, []string{}, wfa.GetType())
if len(options) == 0 {
options = []string{}
}
res_mongo, code, err := mongo.MONGOService.Search(word, options, wfa.GetType())
if err != nil {
wfa.Logger.Error().Msg("Could not store to db. Error: " + err.Error())
return nil, code, err