title: references class "Doctrine\ODM\MongoDB\UnitOfWork" but no such service exists
body: <p>I'm currently using Symfony 4 with Doctrine MongoDB Bundle, following the instruction from this link: 
  <a href="https://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html#content_wrapper" rel="nofollow noreferrer">DoctrineMongoDBBundle</a>. So, I have a UserDocument:</p>
  
  <p><strong>src/Document/UserDocument.php</strong></p>
  
  <pre><code>/** @MongoDB\Document(collection="user", repositoryClass="App\Repository\UserRepository") */
  class UserDocument
  {
  
      /**
       * @MongoDB\Id
       * @var ObjectId
       */
      private $id;
  
      /**
       * @MongoDB\Field(type="string", name="first_name")
       * @var string
       */
      private $firstName;
  
      /**
       * @MongoDB\Field(type="string", name="middle_name")
       * @var string
       */
      private $middleName;
  
      /**
       * @MongoDB\Field(type="string", name="last_name")
       * @var string
           */
          private $lastName;
      }
  </code></pre>
  
  <p><strong>src/Repository/UserRepository.php</strong></p>
  
  <pre><code>use Doctrine\ODM\MongoDB\DocumentRepository;
  class UserRepository extends DocumentRepository
  {
  
  }
  </code></pre>
  
  <p><strong>src/Controller/Content.php</strong></p>
  
  <p>class Content extends Controller</p>
  
  <pre><code>{
  
      /**
       * @Route("/content", name="content")
       * @param UserRepository $user
       * @return Response
       */
      public function index(UserRepository $user)
      {
          $user-&gt;findAll();
          return new Response();
      }
  
  
  }
  </code></pre>
  
  <p>So, after running the content page, I got the following error:</p>
  
  <blockquote>
    <p>Cannot autowire service "App\Repository\UserRepository": argument "$uow" of method "__construct()" references class "Doctrine\ODM\MongoDB\UnitOfWork" but no such service exists.</p>
  </blockquote>
  
  <p>The DocumentRepository constructor looks like this:</p>
  
  <pre><code>public function __construct(DocumentManager $dm, UnitOfWork $uow, ClassMetadata $classMetadata)
      {
          parent::__construct($dm, $uow, $classMetadata);
      }
  </code></pre>