Searching one structure with values from another structure

If you need to search one structure with the values from another structure then you can use the code below. It is not as straightforward as in SQL

  1.   
  2. #if ($UtilMethods.isSet($request.getParameter('courseTaken')))  
  3.   
  4.       #set($userList = "+UserProfile.userId:(")  
  5.       #foreach($course in $dotcontent.pull("+structureName:Courses $!{courseId} ","0","modDate desc"))  
  6.             #set($userList = "$userList $course.userUid or")  
  7.       #end  
  8.       #set($userList = "$userList )")  
  9.       #set($query = "+structureName:UserProfile +UserProfile.userType:*Alumni* $!{userList} $!{location}")  
  10.   
  11.       $query  
  12.   
  13. #end  
comments powered by Disqus