How to make loadByProperties or entityQuery case sensitive for field value Neither loadByProperties or entityQuery are case sensitive. How to make it case sensitive? I'm using MySQL as a database but would rather have a portable solution if possible.
With LoadByProperty
$nodes = $this-&gt;entityTypeManager()
              -&gt;getStorage('node')
              -&gt;loadByProperties(['field_myfield' =&gt; $value]);

With entityQuery
    $entity_ids = \Drupal::entityQuery('node')
        -&gt;condition('field_myfield',$value)
        -&gt;execute();

You can, of course, build your own query as explained in this answer. But my question is specifically about using loadByProperties or entityQuery API.
It was this long issue thread, they add sensitive case support to entityQuery.
So instead of = operation you can use = BINARY or instead of LIKE you can use LIKE BINARY.
Try this:
$entity_ids = \Drupal::entityQuery('node')
  -&gt;condition('field_myfield',$value, '= BINARY')
  -&gt;execute();