How to retrieve all connected data entities from all connectin entities in one query?

I'm refering this to one of the exercises from "Edge Developer bootcamp".

Scenario is something like this,

I have created two collections,

POST /libraries
POST /books

And then added some entities to both. Later, created few connections on libraries.

POST /libraries/Lib1/has/books/test
POST /libraries/Lib2/has/books/<some-name>

Now, I want to retrieve a list of books contained in all libraries that are within a specified number of meters from a location. Assume, I have added location data to libraries entity.

Can you please help me with the query ?

0 1 381
1 REPLY 1

robinm
Participant IV

I came across this query looking to understand results of the "matrix query" as mentioned above.

According to the video ((25:50+) and practical implementation, the correct approach is a query within the URL, replacing the /Lib1 selector with a ql select preceded by a semi-colon. The approximate syntax would be :-

GET /libraries;ql=location within 80000 of -26.21197,28.25958/has

Note: My problem with the query result, however, is where there is more than one library in the radius.

... books are only retrieved for the first library.

I have not found a way to return all the books from all libraries using this method.