programmatically save a taxonomy term

$node = Node::create(array(
    'type' => 'article',
    'title' => 'My Title',
    'langcode' => 'en',
    'uid' => '1',
    'status' => 1,
    'created' => $data[$dateIndex],
    'field_autor' => $data[$autorIndex],
    'field_teaser_text' => $data[$shortIndex],
    'field_mytaxonomy'  => [
      ['target_id' => 12345]
    ]
));
$node->save();