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

Help getting started. #312

Open
mattcollier opened this issue Feb 22, 2019 · 2 comments
Open

Help getting started. #312

mattcollier opened this issue Feb 22, 2019 · 2 comments

Comments

@mattcollier
Copy link

Pun intended.

Looking over the documentation for the find/request API, I'm having difficulty determining how I specify the starting point for my search when my data set is a DAG that looks like this.

    A   B   C 
    |   |   |
    D   |   E
     \  |  /
        F

A search for D starting from B or C should come up empty, but of course D should be found if starting from A.

@gr0uch
Copy link
Member

gr0uch commented Feb 23, 2019

@mattcollier Fortune.js denormalizes all relationships. So you could do something like:

store.find('B', null, null, ['F', 'D'])
store.find('C', null, null, ['E', 'F', 'D'])

It actually doesn't matter where you start from as long as there's a relationship between.

@mattcollier
Copy link
Author

@daliwali thank you for the suggestion.

I have added a minimal runnable example that represents the dataset illustrated above: https://github.com/mattcollier/fortune-experiment/blob/master/index.js

For my use case, I need to call the find API in such a way that I says the starting point of my search is A (alice), which means that the only nodes I should be able to find with a query are D (dianne) and F (franklin).

The graph itself must determine which nodes will be searched. In this case, the search should start at A and terminate at F. B, C, and E should not be findable.

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