1. I have corrected the e-mail settings so that outgoing e-mails from these forums should be sent now. If you tried to Register or Reset your Password, please try again!
    Dismiss Notice

Using c:sort with c:join - Sort by join field?

Discussion in 'Census: DCUO' started by Superskull85, Sep 16, 2014.

  1. Superskull85

    Superskull85 Guest

    I am a little confused if the following functionality exists in the API or not. Say I make this query:


    And I wanted to sort by guild.name inside the guild_id_join_guild hash how might this be done from the query? I have tried using:
    • c:sort=name , c:sort=guild.name , c:sort=guild_id.name - Returns invalid search term
    • c:join addition like: c:join=guild^on:guild_id^sort=name - Ignored (though from the API I did not think this would work anyway)
    Ideally the sort would be something like:

    {    {          "character_id" : ######,          "guild_id" :          {              "name" : ***** // A              "guild_id" : #####          },          "rank" : #    },    {          "character_id" : ######,          "guild_id" :          {              "name" : ***** // B              "guild_id" : #####          },          "rank" : #    }, ...}
    I used the guild collections as examples because character is done. My application for this kind of sort ultimately would be a sorted guild roster hash in the form:

    GuildRoster ={    character.name =>{"id" => character_id, ...}, ...}
    I could do all of this in code but was looking to see if the c:sort can help with this process. Any idea if c:sort can be used with c:join in this way?
  2. airmetforums

    airmetforums Guest

  3. Superskull85

    Superskull85 Guest

    I did not want to include this query at the time because the character collection was down. However this is an idea of what I would want to do:


    I wanted to sort by character_id.name. I could have used the character collection if guild_id was still available but with that removed I see no way I could have the API sort unless by join fields.

    With guild_id in the character collection I could do:


    So I guess I would suggest instead that guild_id be added back to the character collection for applications like this if sorting by join fields won't be possible.
  4. Feldon

    Feldon Guest

  5. Superskull85

    Superskull85 Guest

    Well I can get the entire guild roster with the guild_roster collection but without guild_id being available in other collections or guild_roster missing key fields for sorting and polling it does make it harder to deal with.

    The example I gave was one of them but I was working with feats shortly after this and I had to join the feat and characters_completed_feat with guild_roster and then use code to check if a guild member had a feat and what the name of that feat is.

    It would have been great to do this like this:


    I would not have to even touch the feat and character collections in separate queries or do much processing of the data after the query. I would only need to do a sort but if sorting by join fields would be possible then that would be eliminated as well. (Part of the extra processing has to do with a bug with the characters_active_feat collection which I made a thread about.)

    In the end I guess it is down to how much SOE wants an app to do in terms of data processing on their end.

Share This Page