Q:

How get empty record on date field with entityQuery?

I am on a custom entity with custom fields and i try to get all empty record on date field :
Field was create with CCK, so the field storage has a table.
  $query = \Drupal::entityQuery('test_entity');
        $query->condition('field_date',NULL,'=');
        $ids=$query->execute();

This doesn't work for date field.

A:

Since the field is stored in a single table, this is how i get all empty record from my entity where my custom field is empty :
 $query = \Drupal::entityQuery('test_entity');
        $query->notExists('field_date');
        $ids=$query->execute();

