frostfs-node/pkg/services/object/search/query/v1/keys.go
Leonard Lyubich 8d931b81a6 [#125] object/search: Use latest search filter keys
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-10-29 19:25:54 +03:00

31 lines
932 B
Go

package query
import (
"github.com/nspcc-dev/neofs-api-go/pkg/object"
v2object "github.com/nspcc-dev/neofs-api-go/v2/object"
"github.com/nspcc-dev/neofs-node/pkg/services/object/search/query"
)
// FIXME: this is a temporary solution for object fields filters
func NewRightChildQuery(par *object.ID) query.Query {
q := &Query{
filters: make(object.SearchFilters, 0, 2),
}
q.filters.AddFilter(v2object.FilterHeaderParent, idValue(par), object.MatchStringEqual)
q.filters.AddFilter(v2object.FilterPropertyChildfree, v2object.BooleanPropertyValueTrue, object.MatchStringEqual)
return q
}
func NewLinkingQuery(par *object.ID) query.Query {
q := &Query{
filters: make(object.SearchFilters, 0, 2),
}
q.filters.AddFilter(v2object.FilterHeaderParent, idValue(par), object.MatchStringEqual)
q.filters.AddFilter(v2object.FilterPropertyChildfree, v2object.BooleanPropertyValueFalse, object.MatchStringEqual)
return q
}