How add menu to my node programmatically? This is how i create my node :

    $value= array(
                'type' =&gt; 'page',              
                'title'=&gt;"First node",
                'body' =&gt; array(
                    'value' =&gt; "test",
                    'format' =&gt; 'full_html',
                ),
);

$nodeEntity=\Drupal::entityTypeManager()
            -&gt;getStorage('node')
            -&gt;create($value);

        $nodeEntity-&gt;save();


This work fine.

But i try to give a menu parent to this node.

i try that : 

$value= array(
            'type' =&gt; 'page',              
            'title'=&gt;"First node",
            'body' =&gt; array(
                'value' =&gt; "test",
                'format' =&gt; 'full_html',
            ),
            'menu'=&gt;array(
             'title'=&gt;"First node",
             'menu_parent'=&gt;6,
             'description' =&gt; '',
             'enabled'=&gt;1

        ),


);

i set the field menu because it's the name of the field in the node edit form.
But for the nodeEntity, this field doesn't exist.

How can i give a parent menu id to my node ?

UPDATE

if i set menu_link instead of menu, i got no error i still can't see the menu on the node.
After look into the database and some test, this is how i add a menu to my node on the creation or on node update :

For this example, i load a node :

  $nodeEntity=\Drupal::entityTypeManager()
            -&gt;getStorage('node')
            -&gt;load(312);



  After you create the link :


$menu_link = MenuLinkContent::create([
    'title' =&gt; 'name of your menu',
    'link' =&gt; ['uri' =&gt; 'internal:/node/' . $nodeEntity-&gt;id()],
    'menu_name' =&gt; 'main',
    'expanded' =&gt; TRUE,
]);

$menu_link-&gt;save();


If you want add a parent to your menu just add this in $menu_link :


  $menu parent is the uuid of the parent menu


'parent' =&gt; 'menu_link_content:' . $menuParent,



  Then you need to update menu_link_content_data


  $this-&gt;database-&gt;update('menu_link_content_data')
            -&gt;fields([
                'link__uri' =&gt; 'entity:node/'.$nodeEntity-&gt;id(),
            ])
            -&gt;condition('id', $menu_link-&gt;id())
            -&gt;execute();


The link between the menu and the node is the link__uri, you need to tell him to reference the entity node.

After that, you ll see your menu link on your node.

I haven't find better solution with Drupal API for now.