Count all the documents in a collection accurately

def count_documents(self, filter={},  *args, **kwargs):
        """
        Count all the documents in a collection accurately
        """
        result = self.collection.count_documents(filter, *args, **kwargs)
        return result