Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Append / character when fetching the kv #152

Merged
merged 1 commit into from Aug 25, 2017
Merged

Append / character when fetching the kv #152

merged 1 commit into from Aug 25, 2017

Conversation

eyalzek
Copy link
Contributor

@eyalzek eyalzek commented Jun 20, 2017

otherwise the operation fetches keys which do not EXACTLY match the
request key. For example, having the following keys:

foo/bar & foo-test/bar

and fetching them with:

consul.kv.get({'key': 'foo', recurse:true}, function(err,kvs,res) {console.log(kvs);});

will return:

[ { LockIndex: 0,
    Key: 'foo/bar',
    Flags: 0,
    Value: 'test1',
    CreateIndex: 171,
    ModifyIndex: 171 },
  { LockIndex: 0,
    Key: 'foo-test/bar',
    Flags: 0,
    Value: 'test2',
    CreateIndex: 10,
    ModifyIndex: 10 } ]

this change will avoid that problem.

otherwise the operation fetches keys which do not EXACTLY match the
request key. For example, having the following keys:

`foo/bar` & `foo-test/bar`

and fetching them with:

`consul.kv.get({'key': 'foo', recurse:true},
function(err,kvs,res) {console.log(kvs);});`

will return:

```
[ { LockIndex: 0,
    Key: 'foo/bar',
    Flags: 0,
    Value: 'test1',
    CreateIndex: 171,
    ModifyIndex: 171 },
  { LockIndex: 0,
    Key: 'foo-test/bar',
    Flags: 0,
    Value: 'test2',
    CreateIndex: 10,
    ModifyIndex: 10 } ]
```

this change will avoid that problem.
@breser breser merged commit 3b3e144 into breser:master Aug 25, 2017
@breser breser mentioned this pull request Aug 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants