cursor.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:aiomongo 作者: ZeoAlliance 项目源码 文件源码
def max_time_ms(self, max_time_ms: Optional[int]) -> 'Cursor':
        """Specifies a time limit for a query operation. If the specified
        time is exceeded, the operation will be aborted and
        :exc:`~pymongo.errors.ExecutionTimeout` is raised. If `max_time_ms`
        is ``None`` no limit is applied.

        Raises :exc:`TypeError` if `max_time_ms` is not an integer or ``None``.
        Raises :exc:`~pymongo.errors.InvalidOperation` if this :class:`Cursor`
        has already been used.

        :Parameters:
          - `max_time_ms`: the time limit after which the operation is aborted
        """
        if not isinstance(max_time_ms, int) and max_time_ms is not None:
            raise TypeError('max_time_ms must be an integer or None')
        self.__check_okay_to_chain()

        self.__max_time_ms = max_time_ms
        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号