correct way to query trough distant relations?

Options

please help. here is example of entity links

apartments -m:1- floors -m:1- sections -m:1- buildings -m:m- projects.

how do i make query that will return every apartment that belongs to a project? is mine structure even correct? do i need more links?

please point me

Answers

  • Max
    Max Member
    Options

    should I in mine scenario also have project link in every entity down the line? like directly link every record in tables like apartments or floors to their parent project with direct m:1 links?

  • Max
    Max Member
    edited September 2023
    Options

    also links in post had mistake, really links are
    apartments -m:1- floors -m:1- sections -m:1- buildings -m:1- projects.
    is did not find how to edit post :)
    so i did get it working, and getting expected results, but being new to platform and with documentation limitations I do not know if that the right way. please advice :)

  • Max
    Max Member
    Options

    ok i guess i realized that mine first approach to use joins was best, so i redone it again and now its a single query, which seems to work flawless, I still hope to hear some advices because may be im still on a wrong track :D