Skip to content

Commit

Permalink
Add name_prefix filtering to Mongo queries
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeckman314 committed Jul 7, 2023
1 parent 06c97db commit 55b6290
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/compliance-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ jobs:
python setup.py install
mkdir reports
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3

- name: Test compliance
run: |
source venv/bin/activate
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ jobs:
with:
name: funnelBin

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3

- name: MongoTest
run: |
chmod +x funnel
Expand Down
4 changes: 4 additions & 0 deletions database/mongodb/tes.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ func (db *MongoDB) ListTasks(ctx context.Context, req *tes.ListTasksRequest) (*t
query["state"] = bson.M{"$eq": req.State}
}

if req.NamePrefix != "" {
query["name"] = bson.M{"$regex": fmt.Sprintf("^%s", req.NamePrefix)}
}

for k, v := range req.GetTags() {
query[fmt.Sprintf("tags.%s", k)] = bson.M{"$eq": v}
}
Expand Down

0 comments on commit 55b6290

Please sign in to comment.