code: public AVQuery<T> whereMatchesKeyInQuery(String key, String keyInQuery, AVQuery<?> query) {
      Map<String, Object> inner = new HashMap<String, Object>();
      inner.put("className", query.getClassName());
      inner.put("where", query.conditions.compileWhereOperationMap());
      if (query.conditions.getSkip() > 0) inner.put("skip", query.conditions.getSkip());
      if (query.conditions.getLimit() > 0) inner.put("limit", query.conditions.getLimit());
      if (!StringUtil.isEmpty(query.getOrder())) inner.put("order", query.getOrder());
  
      Map<String, Object> queryMap = new HashMap<String, Object>();
      queryMap.put("query", inner);
      queryMap.put("key", keyInQuery);
      return addWhereItem(key, "$select", queryMap);
    }
docs: Add a constraint to the query that requires a particular key's value matches a value for a key
  in the results of another AVQuery
  
  @param key The key whose value is being checked
  @param keyInQuery The key in the objects from the sub query to look in
  @param query The sub query to run
  @return Returns the query so you can chain this call.