How do you handle Join or Sub Queries in Everlive?

2 posts, 1 answers
  1. Answer
    Brad Sumner
    Brad Sumner avatar
    28 posts
    Member since:
    Dec 2009

    Posted 02 Aug 2013 Link to this post



    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.

  2. Lyubomir Dokov
    Admin
    Lyubomir Dokov avatar
    43 posts

    Posted 02 Aug 2013 Link to this post

    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.
Back to Top