Let's say that I have the following structure:
posts {
post_key_1 {
user_key: “key”
message: “message”
}
…
}
users {
user_key_1 {
location_key: true
}
…
}
Each user has a location.
How could I get the posts from a certain location (for pagination)? Is there a way to order the posts by the location in the users
node?
One way would be to also include the location_key
in the post nodes, but if the user decides to change his location and there are a lot of posts, there would be too much workload on the server.
In SQL, it would be something like select * from posts join users using(user_key) where location_key = 1
Thanks.