You don't need to create a query to fetch by id as the DocumentRepository
already provides this via it's find($id)
method.
Just use the document manager to fetch the repository
$document = $documentManager->getRepository('FooDocument')->find($id);
You can also use the convenience method find($documentName, $id)
directly on the document manager.
$document = $documentManager->find('FooDocument', $id);