How to create an entityquery in Drupal 8

Public

Get raw version
php
  1. $query = \Drupal::entityQuery('node')
  2. ->condition('status', 1)
  3. ->condition('type', 'article')
  4. ->range(0, 10)
  5. ->sort('created', 'DESC');
  6.  
  7. $nids = $query->execute();