I'm having trouble figuring out how to use the EntityQuery on custom field values. As an example I have a custom field under the User bundle that stores the country in which the user lives. There are three options: US, Canada and Mexico. I'd like to use the EntityQuery to directly query the 'field_country' to get a count of how many live in one country and get their uids. Here is an export from the database for this field:
The closest I've gotten is the code snippet below. This however is not working and I'm not sure where to go from here.
$results = \Drupal::entityQuery('user')
->condition('field_country', 'Canada')
->execute();
Does anybody know? Does the entityquery give me the ability to look specific columns in a field? Thanks!
P.S. I know I could do this with a database query but I'd prefer to do it the Drupal way.