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.
$nodes = $this->entityTypeManager() ->getStorage('node') ->loadByProperties(['field_myfield' => $value]);
$entity_ids = \Drupal::entityQuery('node') ->condition('field_myfield',$value) ->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.