fortune icon indicating copy to clipboard operation
fortune copied to clipboard

Help getting started.

Open mattcollier opened this issue 5 years ago • 2 comments

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 avatar Feb 22 '19 15:02 mattcollier

@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.

gr0uch avatar Feb 23 '19 08:02 gr0uch

@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.

mattcollier avatar Feb 23 '19 17:02 mattcollier