fortune
fortune copied to clipboard
Help getting started.
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.
@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.
@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.