Unverified Commit aa9190c1 authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #130 from ipfs/fix/basic-keys-only

MapDatastore: obey KeysOnly
parents 9db638c1 2badd367
......@@ -64,7 +64,11 @@ func (d *MapDatastore) Delete(key Key) (err error) {
func (d *MapDatastore) Query(q dsq.Query) (dsq.Results, error) {
re := make([]dsq.Entry, 0, len(d.values))
for k, v := range d.values {
re = append(re, dsq.Entry{Key: k.String(), Value: v})
e := dsq.Entry{Key: k.String()}
if !q.KeysOnly {
e.Value = v
}
re = append(re, e)
}
r := dsq.ResultsWithEntries(q, re)
r = dsq.NaiveQueryApply(q, r)
......
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