How do I load multiple nodes by a user reference? I have a content type "property", with an owner field (field_user_ref) which is a user reference.

I want to loop through all of the properties, given a specific user_id.

$user_id = 18273;

$query = new EntityFieldQuery();

$query-&gt;entityCondition('entity_type', 'node')
  -&gt;entityCondition('bundle', 'property')
  -&gt;propertyCondition('field_user_ref', $user_id)
  -&gt;propertyCondition('status', 1);

$result = $query-&gt;execute();  // ERROR

if (!empty($result['node'])) {
  $nids = array_keys($result['node']);
  $nodes = node_load_multiple($nids);

  foreach ($nodes as $node) {
    echo "&lt;br&gt;".$node-title;
  }
}


But this gives an error..

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node.field_user_ref' in 'where clause': SELECT node.nid AS entity_id, node.vid AS revision_id, node.type AS bundle, :entity_type AS entity_type FROM {node} node WHERE (node.field_user_ref = :db_condition_placeholder_0) AND (node.status = :db_condition_placeholder_1) AND (node.type = :db_condition_placeholder_2) 


"field_user_ref" is the name of the field..  property.field_user_ref, so not sure what should be the format here..
And like magic, I've found the answer as a result of this answer..

EntityFieldQuery causing column not found PDO exception

$query-&gt;entityCondition('entity_type', 'node')
  -&gt;entityCondition('bundle', 'property')
  -&gt;fieldCondition('field_user_ref', "uid", $user_id)
  -&gt;propertyCondition('status', 1);