2

How to use image field in a condition of an entity query?

To get X nodes which have no image as value of field_image I've tried this:

$nids = \Drupal::entityQuery('node') ->condition('type','X') ->condition('field_image',NULL , '=') ->execute(); 

it doesn't work I got always empty result.

1 Answer 1

4

You could try: $query->notExists('field_image');

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.