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

How to use the discoveryKey to query values from remote instance? #170

Open
KrishnaPG opened this issue Oct 5, 2019 · 0 comments
Open

Comments

@KrishnaPG
Copy link

Trying to achieve this below scenario, which for some reason is turning out to be complex than is necessary - any help is highly appreciated:

  • I have a db setup locally with the following example code
    const db = hyperdb('./my.db', {valueEncoding: 'utf-8'})
    db.put('foo/bar/baz', 'hi')
    
  • Now, from the docs it is clear that with db.discoveryKey this local data should become accessible remotely
  • What is not clear is, how to use this db.discoveryKey to query the value of foo/bar/baz ?

In other words, I have a db.discoveryKey and I have a field key - I am just interested in getting the latest value for that field key (and possibly its history, if required), without worrying about keeping the data in sync at the remote.

Is there some API call or some simple way to do this? Setting up replication, sockets, network sync seems to be overkill for such simple task. There must be a simpler way that I seem to be missing.

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

1 participant