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

Method to get the latest CID hash of a docstore database object #430

Closed
kalepail opened this issue Aug 8, 2018 · 5 comments
Closed

Method to get the latest CID hash of a docstore database object #430

kalepail opened this issue Aug 8, 2018 · 5 comments

Comments

@kalepail
Copy link

kalepail commented Aug 8, 2018

Would love to be able to pass an option to both the query and get methods of docstore to return the latest CID hash of the return object(s).

@RichardLitt
Copy link
Member

This makes sense to me! PRs would be great for this.

@haadcode
Copy link
Member

haadcode commented Aug 9, 2018

I did something a while ago that may give you this functionality or at least a start for a PR, see https://github.com/orbitdb/orbit-db-docstore/blob/feat/document-revisions/src/DocumentStore.js#L52. Hope this helps.

@kalepail
Copy link
Author

kalepail commented Aug 9, 2018

@haadcode That works perfectly for my purpose!

The query method works perfectly however whenever I pass an options value to the get method I always get back an empty array.

db.get(_id) => returns array of expected object

db.get(_id, {fullOp: true}) => returns empty array
even db.get(_id, {}) => returns empty array

If we can sort that out this ticket is as good as closed!

@kalepail
Copy link
Author

kalepail commented Aug 9, 2018

Ah I see now it's in the feat/document-revisions branch. I'll fiddle with it and see if I can get it safely merged into master and running locally. Pretty far behind at this point.

@haadcode
Copy link
Member

This is possible now. See #281 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants