The function must be called with a documentId