Alright, so let me clear the air at the start. This really isn't "Multi-dimensional" in the sense that you can use one query line of code to get your desired results, but it is a way you can query a Pointer relation in your Class with data from the other Class the Pointer is pointing to.
@tyaramis brought up a rather good question on how he could query for all of the posts in his "Post" class, but restrict it so that it only returned posts if the Author User's country was a certain place. In his Post class he has a column set to be a Pointer that points to the _User class. However, when he tried to use the standard query
equalTo() method and the dot notation I covered in my Pointer Relation article it returned an error. So he was curious how he could achieve his goal.
Example of Wrong Query
query.equalTo("user.country", "USA"); // Returns error
matchQuery(). This method allows us to provide it with a query to match what is inside the pointer.
So, in order to use this with our problem we need to first set up our queries. In this article, I am going to provide the standard way to get all the posts and how to get the posts from users in a specific country.
// Set Up Queries to Grab Posts
var allQuery = new Parse.Query("Post");
var usaQuery = new Parse.Query("Post");
// Set Up Query to Find Specific Posts
var usaPosts = new Parse.Query("_User");
The first two queries are to get the posts, we need two so that we can have one query that grabs ALL of the posts, and one query that we can provide with restrictions in order to get posts where the author is from a specific country.
Now all that is left to do to get all the posts is to run the query
allQuery and do whatever we need to with the post data returned. And to get posts for the specific country, all we have left is to provide the query with the
matchQuery() method, and then run it and process the data how we desire.
// Get all The Posts
/* ... Now do whatever is desired with the post data */
// Get only USA Posts
/* ... Now do whatever is desired with the post data, however the post data will only be from posts where the author's country is USA */
Yay, now we have a way to restrict the posts that are returned to us by which country the author user is from.
Please let me know if you have any questions, and as always, this article's source code is on my GitHub. For this article's source code I used States instead of Countries.
Pointer Relation article: https://coderwall.com/p/cy6cea
matchQuery() documentation: https://www.parse.com/docs/js/symbols/Parse.Query.html#matchesQuery
GitHub CoderWall Repo: https://github.com/ZachCase/CoderWall