public function getUpsertedId() { if ($this->isAcknowledged) { foreach ($this->writeResult->getUpsertedIds() as $id) { return $id; } return null; } throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__); }