Drupal 8 countQuery() kenneth $result = \Drupal::database()->select('node') ->condition('type', 'article') ->countQuery() ->execute()->fetchField();