How to list all nodes attached to a vocabulary? I have a custom vocabulary called "healthcare_terms" that has enabled terms attached to a custom content type called "health_posts". 

I just want to find all nodes that are tagged with enabled terms from "healthcare_terms"

I tried the following but it does not seem to be working.

   $query = \Drupal::entityQuery('node')
      -&gt;condition('type', 'health_posts')
      -&gt;condition('status', 1)
      -&gt;condition('field_tags.entity.name', 'healthcare_terms');
    $ids = $query-&gt;execute();


Clearly I am lost. Any help or tips?

Thanks guys
Are you sure that you are using the tags field for this?

You're filtering on the term name, but you want to filter on the term vid instead:

 $query = \Drupal::entityQuery('node')
  -&gt;condition('type', 'health_posts')
  -&gt;condition('status', 1)
  -&gt;condition('field_tags.entity.vid', 'healthcare_terms');
$ids = $query-&gt;execute();


If you have a standalone field that only allows terms from your healthcare_terms vocabulary, which is usually the better approach, then you can just look for ->exists('field_something').