Query - Content type I want to get all created content of some content type by query. By now I can access nodes by their ID. 

$MyNode = \Drupal\node\Entity\Node::load(1)

I tried some query, but none of them worked for me. Maybe wrong conditions. My content type is 'beacons'. 

$query = \Drupal::entityQuery('node')


Cant find it in my d8 book too.
The following should suffice:

$query = \Drupal::entityQuery('node')
  -&gt;condition('type', 'beacons');
$entity_ids = $query-&gt;execute();


Here is a drush one-liner to test this on my D8 instance, where I have one article node:

 drush ev "var_dump(\\Drupal::entityQuery('node')-&gt;condition('type','article')-&gt;execute());"


Gives me:

array(1) {
  [101]=&gt;
  string(3) "101"
}


where 101 is the nid of the article node.

Good luck!