2020-09-23 10:41:09 +00:00
|
|
|
package query
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-api-go/pkg/object"
|
2020-10-29 14:57:07 +00:00
|
|
|
v2object "github.com/nspcc-dev/neofs-api-go/v2/object"
|
2020-09-23 10:41:09 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/services/object/search/query"
|
|
|
|
)
|
|
|
|
|
|
|
|
// FIXME: this is a temporary solution for object fields filters
|
|
|
|
|
2020-10-01 12:12:39 +00:00
|
|
|
func NewRightChildQuery(par *object.ID) query.Query {
|
|
|
|
q := &Query{
|
|
|
|
filters: make(object.SearchFilters, 0, 2),
|
|
|
|
}
|
2020-09-23 10:41:09 +00:00
|
|
|
|
2020-10-29 14:57:07 +00:00
|
|
|
q.filters.AddFilter(v2object.FilterHeaderParent, idValue(par), object.MatchStringEqual)
|
|
|
|
q.filters.AddFilter(v2object.FilterPropertyChildfree, v2object.BooleanPropertyValueTrue, object.MatchStringEqual)
|
2020-09-23 10:41:09 +00:00
|
|
|
|
2020-10-01 12:12:39 +00:00
|
|
|
return q
|
2020-09-23 10:41:09 +00:00
|
|
|
}
|
2020-10-01 09:02:53 +00:00
|
|
|
|
|
|
|
func NewLinkingQuery(par *object.ID) query.Query {
|
2020-10-01 12:12:39 +00:00
|
|
|
q := &Query{
|
|
|
|
filters: make(object.SearchFilters, 0, 2),
|
|
|
|
}
|
|
|
|
|
2020-10-29 14:57:07 +00:00
|
|
|
q.filters.AddFilter(v2object.FilterHeaderParent, idValue(par), object.MatchStringEqual)
|
|
|
|
q.filters.AddFilter(v2object.FilterPropertyChildfree, v2object.BooleanPropertyValueFalse, object.MatchStringEqual)
|
2020-10-01 12:12:39 +00:00
|
|
|
|
|
|
|
return q
|
2020-10-01 09:02:53 +00:00
|
|
|
}
|