Commit 9978dc41 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

Query.KeysOnly

parent e79d8609
......@@ -81,13 +81,17 @@ func (d *datastore) Query(q dsq.Query) (*dsq.Results, error) {
var es []dsq.Entry
for i.Next() {
cpy := make([]byte, len(i.Value()))
copy(cpy, i.Value())
es = append(es, dsq.Entry{
Key: ds.NewKey(string(i.Key())).String(),
Value: cpy,
})
k := ds.NewKey(string(i.Key())).String()
e := dsq.Entry{Key: k}
if !q.KeysOnly {
buf := make([]byte, len(i.Value()))
copy(buf, i.Value())
e.Value = buf
}
es = append(es, e)
}
i.Release()
if err := i.Error(); err != nil {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment