forked from TrueCloudLab/frostfs-node
[#61] object/search: Support non-root and non-leaf filters
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>support/v0.27
parent
51e373c3f0
commit
6824a6f67b
|
@ -45,9 +45,9 @@ func (q *Query) Match(obj *object.Object, handler func(*objectSDK.ID)) {
|
|||
default:
|
||||
match = headerEqual(obj, key, q.filters[i].Value())
|
||||
case objectSDK.KeyRoot:
|
||||
match = !obj.HasParent()
|
||||
match = (q.filters[i].Value() == objectSDK.ValRoot) == !obj.HasParent()
|
||||
case objectSDK.KeyLeaf:
|
||||
match = par == nil
|
||||
match = (q.filters[i].Value() == objectSDK.ValLeaf) == (par == nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue