This is a migrated thread and some comments may be shown as answers.

How do you handle Join or Sub Queries in Everlive?

1 Answer 85 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brad Sumner
Top achievements
Rank 1
Brad Sumner asked on 02 Aug 2013, 01:18 PM


How does Everlive handle more complex queries on either the client side or server side in cases where you want to perform a subquery or join where joining tables are involved?  From the documentation I can see where you can use array filters but the scenario I'm thinking of would require a query against another table.

Given something like the following table structure is there a way to retrieve  Teams that a user is tied to via the UserTeam content type?  There may be additional fields in the UserTeam content type which is why I would prefer it as a content type and not just a multi relation between User and Team.  

User
-UserId
-UserName

Team
-TeamId
-TeamName

UserTeam
-UserId
-TeamId

**Update**
I just ran across the Power Fields documentation so I think the answer to my question is in there.

1 Answer, 1 is accepted

Sort by
0
Lyubomir Dokov
Telerik team
answered on 02 Aug 2013, 02:01 PM
Hello Brad,

Indeed, the Power Fields feature is what you are looking for.

As you will see, the power fields are defined in a header(client side). If fetching linked records is the default for your app, you might want to make it server-side, without the need to define power fields in each client. To do that you could define the power fields in the cloud code in the beforeRead hook.

As powerful as they are, some restrictions apply to power fields. You can have up to 5 power fields for a single query. Also, power fields are only evaluated if the query returns 50 or less records. If you have more records and you want power fields to work you must use paging and only get up to 50 records per request.

Aside from that, our feature plans include something like "expand" option for GET queries. This will automatically fetch connected records from other content types without the need to define power fields.

If you have any questions, do not hesitate to contact us, we will be happy to help.

Regards,
Lyubomir Dokov
Telerik

Do you enjoy Icenium? Vote for it as your favorite new product here (use short code H048S).
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
Tags
General Discussion
Asked by
Brad Sumner
Top achievements
Rank 1
Answers by
Lyubomir Dokov
Telerik team
Share this question
or