in Education by
I have Conversation classes with a members relation attribute pointing to User class. This members attribute consists of people belong to a particular conversation. Now I want to query if given array of pointers User is part of particular conversation given that all elements must match. I tried to use containsAll("members", users) but instead got undefined. containedIn() worked but it returned all matching conversation that has at least one matching User in array. equalTo("members", users) was not working as well and note that the users variable is array of pointers and not just array of strings objectId, but I also tried that one but got me nowhere. Here's what I tried: * Created AND queries where userRelationQuery.equalTo('member', ParseUser1) up to N number of users and still didn't work Here's my solution but feel free to correct this for improvement const members = getMembers(); let query = new Parse.Query("Conversation").equalTo( "members", members[0] ); for (let i = 0; i < members.length; i++) { query = new Parse.Query("Conversation") .matchesKeyInQuery("objectId", "objectId", query) .equalTo( "members", members[i] ); } const chat = await query.includeAll().first(); JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
This should work for you var conversationClass = Parse.Object.extend('Conversation'); var conversationQuery = new Parse.Query(conversationClass); return conversationQuery.first() .then(queryResult => { var userRelationQuery = queryResult.relation('members').query(); //You can get all users releated to this conversation //userRelationQuery.equalTo('username', 'Blank0330') // Or you can add more conditions return userRelationQuery.find() .then(users => { return users; //This is your releated users }); }); For more information about Parse-JS-SDK Relation

Related questions

0 votes
    Match column I with column II and select the correct answer using the codes given below the columns. Column - I Political ... 2, D - 4 Select the correct answer from above options...
asked Aug 3, 2022 in Education by JackTerrance
0 votes
    Match the items in column A' with the proper ones in coloum B' and explain their impact ... Science,Science proposed by,electromagnetic theory engineering physics,Science nptel...
asked Nov 7, 2021 in Education by JackTerrance
0 votes
    If access paths are available on all the conditions of a disjunctive selection, each index is scanned ... Operation in division Query Processing Techniques of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    Shown below is the input NumPy array. Delete column two and replace it with the new column given below....
asked Apr 24, 2021 in Technology by JackTerrance
0 votes
    I wrote a C# function of DLL that returns a byte pointer that points to an array of pointers that ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 3, 2022 in Education by JackTerrance
0 votes
    What are the advantages of using an array of pointers to string instead of an array of strings?...
asked Jan 22, 2021 in Technology by JackTerrance
0 votes
    What is an array of pointers?...
asked Jan 22, 2021 in Technology by JackTerrance
0 votes
    What is the difference between pointer to an array and array of pointers?...
asked Jan 22, 2021 in Technology by JackTerrance
0 votes
    i want to delete the wullfi row by match the authid i must also say the aid is change so cant ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    Match the Xenon compounds Column-I with its structure in Column-II and assign the correct code : Column-I Column-II ( a ... i ) (iv) ( Select the correct answer from above options...
asked Jan 2, 2022 in Education by JackTerrance
0 votes
    Match column A with Column B Column A Column B 1. Expert System A. Simulate how a human would behave as a conversational ... D; 4 -> B Select the correct answer from above options...
asked Nov 13, 2021 in Education by JackTerrance
0 votes
    Match column A with Column B Column A Column B 1. Problem Scoping A. implement a suitable model that matches the ... ; 4 -> B Select the correct answer from above options...
asked Nov 13, 2021 in Education by JackTerrance
0 votes
    Match Column A with Column B: Column A Column B 1. Face recognition machine (i) Not AI 2. Automatic door (ii) AI 3. ... i) ; 4 -> (ii) Select the correct answer from above options...
asked Nov 13, 2021 in Education by JackTerrance
0 votes
    Match the columns: Column I Column II (1) Physical, chemical and biological factors together form ( ... Science proposed by,electromagnetic theory engineering physics,Science nptel...
asked Nov 8, 2021 in Education by JackTerrance
0 votes
    Match the columns: Column I Column II (1) Basic functional unit in the environment (a) ... ,Science proposed by,electromagnetic theory engineering physics,Science nptel...
asked Nov 8, 2021 in Education by JackTerrance
...