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

HowToX : Is it possible to iterate on View with a subset ? #82

Closed
jbpin opened this issue Feb 2, 2018 · 3 comments
Closed

HowToX : Is it possible to iterate on View with a subset ? #82

jbpin opened this issue Feb 2, 2018 · 3 comments

Comments

@jbpin
Copy link
Contributor

jbpin commented Feb 2, 2018

Hi,
All is in the title.. I want to iterate on the view for a subset of key as with syndtr/goleveldb

iter := db.NewIterator(util.BytesPrefix([]byte("foo-")), nil)
for iter.Next() {
   // Use key/value.
   ...
}
iter.Release()
err = iter.Error()

Can you give me some direction please ? I'm also keen to manage a PR for that if necessary.

@db7
Copy link
Collaborator

db7 commented Feb 4, 2018

The View iterator would does not provide that. But if you want to implement that, go ahead. You'll find the iterator implementation inside storage. You can combine the iterators of each partition (since each partition is a DB) with the multi iterator, also defined in the storage package. Let me know if you need some help.

@db7
Copy link
Collaborator

db7 commented Feb 19, 2018

Thanks for contributing. I'll close this issue since your PR #85 resolves it.

@db7 db7 closed this as completed Feb 19, 2018
@jbpin
Copy link
Contributor Author

jbpin commented Feb 19, 2018 via email

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

No branches or pull requests

2 participants