How do I retrieve a menu using its link? Let say I have a menu item with these attributes

'title' =&gt; 'Menu Title',
'link' =&gt; ['uri' =&gt; 'internal:/taxonomy/term/1217'],
'menu_name' =&gt; 'my-menu',
'expanded' =&gt; TRUE,


I can find all the menus by their title, e.g.,

 $menu_links = \Drupal::entityTypeManager()-&gt;getStorage('menu_link_content')
                -&gt;loadByProperties(['title' =&gt; 'Menu Title']);

if ($menu_link = reset($menu_links)) {
// Get the pid of the first menu
    $menu_pid = $menu_link-&gt;getPluginId();
}


Then I tried to retrieve menu by the link property, and I couldn't.
I tried:

 $menu_links = \Drupal::entityTypeManager()-&gt;getStorage('menu_link_content')
                -&gt;loadByProperties(['link' =&gt; array('uri' =&gt; 'internal:/taxonomy/term/1217')]);

 $menu_links = \Drupal::entityTypeManager()-&gt;getStorage('menu_link_content')
                -&gt;loadByProperties(['link' =&gt; ['uri' =&gt; 'internal:/taxonomy/term/1217']]);

 $menu_links = \Drupal::entityTypeManager()-&gt;getStorage('menu_link_content')
                -&gt;loadByProperties(['uri' =&gt; 'internal:/taxonomy/term/1217']);


None of them worked.
Try the property link.uri:

$menu_links = \Drupal::entityTypeManager()-&gt;getStorage('menu_link_content')
  -&gt;loadByProperties(['link.uri' =&gt; 'internal:' . $path]);