Just wondering if I'm doing it right or if there is a better way.
I have 3 tables, Game, User and UserGame . UserGame is a connection table with pointers to game and user tables.
The following script returns all the games the user has joined.
var Game = Parse.Object.extend("Game");
var UserGame = Parse.Object.extend("UserGame");
var innerQuery = new Parse.Query(Game);
var query = new Parse.Query(UserGame);
query.equalTo("user", user);
query.matchesQuery("game", innerQuery);
query.include("game");
query.find({
Now I am trying to return games that the user has not joined. I tried the reverse request above, but it does not work. Any ideas?
There is also a better solution than using the connection table above, should I just add a list of game pointers to the user table?
source
share