How do I fetch the values of an entity's field? How to query all the values of a particular field. I used Drupal\Core\Database\Connection object to fetch the values as below:

$connection = \Drupal::database();
$result = $connection-&gt;select('node__body', 'n')
  -&gt;fields('n', array('body_value'))
  -&gt;execute()-&gt;fetchCol();


Is there any Drupal 8 API specifically for this?  I need to fetch all values of the field and fetch the field values for a particular node bundle.
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...).