EntityFieldQuery with fieldCondition returns nothing I have created a custom entity, called 'point'.

I'm able to get all of the entities in the db, with this:

$query = new EntityFieldQuery();
$query-&gt;entityCondition('entity_type', 'point')
    -&gt;entityCondition('bundle', 'point');
$result = $query-&gt;execute();


But when I add a fieldCondition, to make sure I only get the one single entity I want, I'll get an empty array back.

It looks like this:

$query = new EntityFieldQuery();
$query-&gt;entityCondition('entity_type', 'point')
    -&gt;entityCondition('bundle', 'point')
    -&gt;fieldCondition('field_point_unique_number', 'value', $unique_number, '=');
$result = $query-&gt;execute();


Where $unique_number is a textstring. And it's not a typo in the textstring.
In the db the field 'field_point_unique_number' is a varchar, but only contains numbers.

Why does the fieldCondition return nothing?
I hadn't checked it for trailing spaces. So using trim() on $unique_number did the trick. Thanks for leading me the right way Clive!