this is the structure of my Database with the classes:
User -> objectId (String) username (String)
Friends -> objectId (String) toUser (Pointer <_User> ) fromUser (Pointer <_User> )
My goal is to retrieve the users with the usernames, which matches the columns toUser and fromUser with a specific Id. The Pointer of toUser and fromUser variable is the objectId of the table "User"
How my query should be?
I tried this one but it doesn`t work
Parse.Cloud.define('FriendsQuery', function(req,res) {
const friends = new Parse.Query("Friends");
friends.equalTo("toUser","fEjQgAPvDO");
const userQuery = new Parse.Query("User");
userQuery.matchesQuery('friend', friends);
userQuery.find().then((results) => {
res.success(results);
})
.catch(() => {
response.error("user lookup failed");
});
});
I have included only the toUser column in this query
Any idea?
Thank You