How do I fetch the values of an entity's field?
In Drupal 7, you would use the EntityFieldQuery class. In Drupal 8, there is an equivalent service.

$query = \Drupal::entityQuery('node')
    -&gt;condition('status', 1)
    -&gt;condition('changed', REQUEST_TIME, '&lt;')
    -&gt;condition('title', 'cat', 'CONTAINS')
    -&gt;condition('field_tags.entity.name', 'cats');

$nids = $query-&gt;execute();


In your case, instead of field_tag.entity.name, you need body.body_value. See EntityFieldQuery has been rewritten.
If you just need to get all the node IDs, remove all the condition() lines, and then use entity_load_multiple('node', $nids) to load the full node objects.

In this way, your code is not making assumptions about the tables used to contain the node data. Plus, it can be easily extended to filter the nodes basing on some criteria (node properties, content of fields...).