Page 1 of 1

related collections reg

Posted: Mon Nov 25, 2013 9:52 pm
by chansdad

How to get related collections all in one db query ? Let us say I have a students collection and then another collection called class. _id of student collection is in the class collection as student_Id .
How do i go about running a query on class collection and include the sudent collection in the result.

Basically think of retrieving all the students in the class and their details ..

Appreciate your reply


related collections reg

Posted: Mon Nov 25, 2013 10:07 pm
by Maryna Brodina

Hello! Please take a look here http://docs.appery.io/documentation/b... (see Including_related_objects section)


related collections reg

Posted: Mon Nov 25, 2013 10:58 pm
by chansdad

Thanks .. I created a pointer column and was able to include the object int he query result

When i try to wire the liocal storage id into this pointer column , record is not being saved .

How do i get the id into this pointer column ? from a local storage .

Regards


related collections reg

Posted: Mon Nov 25, 2013 11:32 pm
by Alena Prykhodko

Hello! Please show us exact steps you tried.


related collections reg

Posted: Tue Nov 26, 2013 3:55 pm
by chansdad

Please see the attached screenshot . i highlighed the pntr and when i remove that connection , record gets stored , when i have that connection record does not get stored and the the screen does not move to the next screen ..
Image


related collections reg

Posted: Tue Nov 26, 2013 5:25 pm
by chansdad

Never mind . I figured it out

var parmvalue = {"collName" : "linknext_userprofiles","id" : localStorage.getItem("linknextuserid")};
return parmvalue;

Interesintgly i did not have to again do a JSON.Stringify . Object could be passed in the request .