Daan
Posts: 0
Joined: Thu Mar 05, 2015 1:24 pm

distinct related objects from collection

hi there,

i have 3 collections that are connected via pointer values, all is working well, but now when i show the results i can't get it to show the distinct value off the related collections.

Example ;
i register where it takes places in collection A
i register a question list in collection B
i register the answers and pointers to collection A and B in collection C.

now i want to list the answers from collection C with the related information from collection A and B in a list (or collapsible block or grid).

I want some of the information from collection A in a header/block/toprow and some of the information from B and C in the content / rows.

What should my approach be ?

screenshot of the mapping i did now ;

Image

Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

distinct related objects from collection

Hello Daan,

First of all all pointers should be with type pointer, and has _id of pointing object.

Once Collection C has 2 pointers with ids to A and B you can import in the editor service Read for C collection.
During import editor will generate structure of response, all you have to do now is map it to your page.

Attached image looks right from first sight.

Daan
Posts: 0
Joined: Thu Mar 05, 2015 1:24 pm

distinct related objects from collection

Hi Egor,

thanks for your reply.

i have fixed it by creating an detail page and listing all items from "collection A".
when i click on a list item it set the id of "collection a" item in LSV and then passes that to a query displays all related information (on a detail content page), that runs good.

But all goes well except for the items u see in the screenshot below (marked yellow).

Any suggestions what might be the problem ?
the "js" on the mapping is to not show "undefined" nothing else.

Image

edit :
the 3 items show the value of the first entry of the collection instead of related information.

Regards,
Daan

Daan
Posts: 0
Joined: Thu Mar 05, 2015 1:24 pm

distinct related objects from collection

and this is in the "where" clause "before send" ;

console.log("value = " + value);
var whereObject = {idBeoordStart:{"$inQuery":{_id: value } }};
console.log("whereObject = " + JSON.stringify(whereObject));
return JSON.stringify(whereObject);

Daan
Posts: 0
Joined: Thu Mar 05, 2015 1:24 pm

distinct related objects from collection

nevermind, deleting and adding the service seems to have solved the problem...

Return to “Issues”