v3api: Add a flag to RangeRequest to return only the keys.
Currently the user can't list only the keys in a prefix search. In order to support such operations the filtering will be done on the server side to reduce the encoding and network transfer costs.
This commit is contained in:
@ -270,6 +270,9 @@ func (a *applierV3backend) Range(txnID int64, r *pb.RangeRequest) (*pb.RangeResp
|
||||
|
||||
resp.Header.Revision = rev
|
||||
for i := range kvs {
|
||||
if r.KeysOnly {
|
||||
kvs[i].Value = nil
|
||||
}
|
||||
resp.Kvs = append(resp.Kvs, &kvs[i])
|
||||
}
|
||||
return resp, nil
|
||||
|
Reference in New Issue
Block a user