cursor.py 文件源码

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

项目:aiomongo 作者: ZeoAlliance 项目源码 文件源码
def limit(self, limit) -> 'Cursor':
        """Limits the number of results to be returned by this cursor.

        Raises :exc:`TypeError` if `limit` is not an integer. Raises
        :exc:`~pymongo.errors.InvalidOperation` if this :class:`Cursor`
        has already been used. The last `limit` applied to this cursor
        takes precedence. A limit of ``0`` is equivalent to no limit.

        :Parameters:
          - `limit`: the number of results to return

        .. mongodoc:: limit
        """
        if not isinstance(limit, int):
            raise TypeError('limit must be an integer')

        self.__check_okay_to_chain()

        self.__limit = limit
        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号