Josette
Posts: 0
Joined: Mon Jun 08, 2015 10:59 pm

How to filter query results using Pointers.

I created a collection that shows the requests to another user to become a contact for the person who sent the request. The collection shows the sender and receiver of the request and the status of the request. In the app the contacts page should show only the contacts for the user. The contact request collection's sender and receiver fields point to the user profile collection, where information for each user is stored. However, when I query the database to get the contacts for that individual, their information also appears in the results. I need a way to not include the current not to show in the results, even though I am using their id to query the contact request collection.

I tried using Javascript to add the data result to local storage, but I was unable to add the data to the local storage contact array list using 'Apperyio.storage.userprofile.set("$['']");

Here is an example of the database query:

var userprofileid = localStorage.getItem("profileid");
var cstatus = localStorage.getItem("contactstatus");

return '{"$and":[{"$or":[{"sender_id": {"collName":"user_profiles", "id":"'+userprofileid+'"}}, {"receiver_id": {"collName":"user_profiles", "id":"'+userprofileid+'"}}]}, {"status": {"collName":"contact_status", "_id":"'+cstatus+'"}}]}';

Thank you.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

How to filter query results using Pointers.

Hello,

Could you clarify what exactly doesn't work? Could you send us screenshots of service settings and request parameters pages?

Return to “Issues”