Justin Porter Posted October 23, 2018 Report Share Posted October 23, 2018 Hey all, I'm trying to gather the names of lists with a specific custom attribute that shots belong to. My question is two-fold: 1) Is there a way to return JUST the values I'm after in these queries? For example in the query below, from each shot I want only the lists with the "flagRV" attribute returned. Right now it returns all lists associated with the shot: select name, project.name, project_id, lists.name, lists.custom_attributes from Shot where project.name = {0} and name in ({1}) and lists.custom_attributes any (key is "flagRV" and value is "True") In this next query, I've reversed the logic to lookup by lists, but only want items (shots) returned that are mentioned in the query - right now it returns ALL items/shots in the resulting lists: select name, project.name, project_id, items.name from TypedContextList where project.name = {0} and custom_attributes any (key is "flagRV" and value is "True") and items any (name in ({1})) 2) Assuming the answer to my first question is NO, is there a way to pre-project data for nested items? With the queries above, only the shot/list ids are returned, even though I'm trying to explicitly return the names. In this scenario, lazy queries are not an option, so the data has to be pre-projected. Thanks! Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted October 25, 2018 Report Share Posted October 25, 2018 Hi Justin, Do you want to retrieve both the shot and the list in the same query? But nothing else from the collections - i.e. not all entries in the list and not all lists). Unfortunately I'm not sure this can be done with less than two queries. Link to comment Share on other sites More sharing options...
Justin Porter Posted November 21, 2018 Author Report Share Posted November 21, 2018 Yes, I'm trying to just return the list names a shot belongs to that have specific custom attribute values. It doesn't look like I'm able to do what I'm after in one query without having to do a bunch of post-processing/iterating through the lists. Link to comment Share on other sites More sharing options...
JPrydz Posted December 20, 2018 Report Share Posted December 20, 2018 Hi, As mentioned earlier, this needs to be done with two queries. Do you think that would be ok? /Johan Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.