Skip to content

Commit

Permalink
[filtering] add "has_parent" query field (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrparkers authored May 21, 2021
1 parent 1c94587 commit 52d9c8e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions go/v1beta1/storage/filtering/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type Query struct {
QueryString *QueryString `json:"query_string,omitempty"`
Nested *Nested `json:"nested,omitempty"`
Range *Range `json:"range,omitempty"`
HasParent *HasParent `json:"has_parent,omitempty"`
}

// Bool holds a general query that carries any number of
Expand Down Expand Up @@ -58,6 +59,12 @@ type Nested struct {
// Holds an operator that evaluates a range for comparisons
type Range map[string]*RangeOperator

// HasParent is used to query for resources that use a join field and have a parent resource
type HasParent struct {
ParentType string `json:"parent_type"`
Query *Query `json:"query"`
}

type RangeOperator struct {
Greater string `json:"gt,omitempty"`
GreaterEquals string `json:"gte,omitempty"`
Expand Down

0 comments on commit 52d9c8e

Please sign in to comment.