How do I get a list of nodes that have a reference to a given user? I can get a node's referenced users like so:

$users = $node-&gt;get('field_allowed_editors')-&gt;getValue();


But how can I get a reverse list? Getting all the nodes that have a certain user referenced?
You can use an entity query:

$nids = \Drupal::entityQuery('node')
  -&gt;condition('type', 'article')
  -&gt;condition('field_allowed_editors', $userid)
  -&gt;execute();                          


This will result in an array with all node id's that match the conditions.