Entity Query not returning all results For some reason, my EntityQuery is returning 60 articles.  There are actually 63 of them.  I am certain about this.

Here are some questions I have:


I don't think revisions are enabled for my content types, but how do I check? And, how do I do this programmatically? I'm not sure if my EntityQuery is returning nids or vids...
Why would EntityQuery be unable to find an article? It seems like it can't find it, even if I just search for nodes containing part of its title. It returns 0 results.


Here's what I've tried:

I did a loop and loaded the nodes from the nids, printed out the titles, and I copy pasted the node titles (filtered on articles) from the content list, did a diff with the alphabetized results to find the three articles which EntityQuery doesn't believe to exist.  They are all normal seeming articles, which can be viewed/edited.

I started debugging into the core EntityQuery files, but I'm afraid at this rate it's going to take me a while before I understand what's going on.  Does anyone know why an EntityQuery might not find certain nodes, or even have an idea where I should be looking in the core files, or what I might be expecting to look for in the DB tables?

I'm using MySQL 5.7, in case that's relevant at all.

EDIT: Someone asked for the code, I am doing an EntityQuery for all articles, yet I don't get all of them:

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

foreach($entity_ids as $id){
  echo $id-&gt;getTitle() . "\n";
  // Do I do Drupal entity node load, or do I load via revision ID?
  // Here I would like to load the node and then do stuff with it...
}
I added metadata to the query, running it as user 1, which allowed it to get all of the nodes:

$query = \Drupal::entityQuery('node')
    -&gt;condition('type', 'article')
    -&gt;addMetaData('account', \Drupal\user\Entity\User::load(1)); // Run the query as user 1.
$nids = $query-&gt;execute();

echo "count: " . $query-&gt;count()-&gt;execute() . "\n";

foreach ($storage-&gt;loadMultiple($nids) as $node){
  //do stuff
}


Also, since revisions are allowed for nodes, it was returning $nids as revision_id => entity_id as Berdir said in his comment.