Entity field query condition to match multi-value field Using EFQ, I want to add a fieldCondition that has to match both values in a multi-value field (fixed at two values). The following doesn't seem to work:

$query = new EntityFieldQuery();
$query-&gt;entityCondition('entity_type', 'node')
       -&gt;entityCondition('bundle', 'node_type')
       -&gt;fieldCondition('field_myfield', 'target_id', array(
          $id_1,
          $id_2
        ), '=');


This returns the error:


  PDOException: SQLSTATE[21000]: Cardinality violation: 1241 Operand
  should contain 1 column(s):
$query = new EntityFieldQuery();
$query-&gt;entityCondition('entity_type', 'node')
       -&gt;entityCondition('bundle', 'node_type')
       -&gt;fieldCondition('field_myfield', 'target_id', array(
          $id_1,
          $id_2
        ), 'IN');


For reference see https://www.drupal.org/docs/7/creating-custom-modules/howtos/how-to-use-entityfieldquery-for-drupal-7