Python bson 模块,_iterate_elements() 实例源码

我们从Python开源项目中,提取了以下7个代码示例,用于说明如何使用bson._iterate_elements()

项目:mongodb-monitoring    作者:jruaux    | 项目源码 | 文件源码
def __inflated(self):
        if self.__inflated_doc is None:
            # We already validated the object's size when this document was
            # created, so no need to do that again.
            self.__inflated_doc = dict(
                element for element in _iterate_elements(
                    self.__raw, 4, _UNPACK_INT(self.__raw[:4])[0] - 1,
                    self.__codec_options))
        return self.__inflated_doc
项目:covar_me_app    作者:CovarMe    | 项目源码 | 文件源码
def __inflated(self):
        if self.__inflated_doc is None:
            # We already validated the object's size when this document was
            # created, so no need to do that again.
            self.__inflated_doc = dict(
                element for element in _iterate_elements(
                    self.__raw, 4, _UNPACK_INT(self.__raw[:4])[0] - 1,
                    self.__codec_options))
        return self.__inflated_doc
项目:kekescan    作者:xiaoxiaoleo    | 项目源码 | 文件源码
def __inflated(self):
        if self.__inflated_doc is None:
            # We already validated the object's size when this document was
            # created, so no need to do that again.
            self.__inflated_doc = dict(
                element for element in _iterate_elements(
                    self.__raw, 4, _UNPACK_INT(self.__raw[:4])[0] - 1,
                    self.__codec_options))
        return self.__inflated_doc
项目:flask-zhenai-mongo-echarts    作者:Fretice    | 项目源码 | 文件源码
def __inflated(self):
        if self.__inflated_doc is None:
            # We already validated the object's size when this document was
            # created, so no need to do that again. We still need to check the
            # size of all the elements and compare to the document size.
            object_size = _UNPACK_INT(self.__raw[:4])[0] - 1
            position = 0
            self.__inflated_doc = {}
            for key, value, position in _iterate_elements(
                    self.__raw, 4, object_size, self.__codec_options):
                self.__inflated_doc[key] = value
            if position != object_size:
                raise InvalidBSON('bad object or element length')
        return self.__inflated_doc
项目:Data-visualization    作者:insta-code1    | 项目源码 | 文件源码
def __inflated(self):
        if self.__inflated_doc is None:
            # We already validated the object's size when this document was
            # created, so no need to do that again.
            self.__inflated_doc = dict(
                element for element in _iterate_elements(
                    self.__raw, 4, _UNPACK_INT(self.__raw[:4])[0] - 1,
                    self.__codec_options))
        return self.__inflated_doc
项目:hudl-bugbounty    作者:lewislabs    | 项目源码 | 文件源码
def __inflated(self):
        if self.__inflated_doc is None:
            # We already validated the object's size when this document was
            # created, so no need to do that again.
            self.__inflated_doc = dict(
                element for element in _iterate_elements(
                    self.__raw, 4, _UNPACK_INT(self.__raw[:4])[0] - 1,
                    self.__codec_options))
        return self.__inflated_doc
项目:hudl-bugbounty    作者:lewislabs    | 项目源码 | 文件源码
def __inflated(self):
        if self.__inflated_doc is None:
            # We already validated the object's size when this document was
            # created, so no need to do that again.
            self.__inflated_doc = dict(
                element for element in _iterate_elements(
                    self.__raw, 4, _UNPACK_INT(self.__raw[:4])[0] - 1,
                    self.__codec_options))
        return self.__inflated_doc