Entity Field Query example

$b = new EntityFieldQuery();
$b->entityCondition('entity_type', 'node')
  ->entityCondition('bundle', 'bill')
  ->propertyCondition('status', NODE_PUBLISHED)
  ->fieldCondition('field_sessions', 'target_id', 10171);
$result = $b->execute();

dpm($result);