(name, value, check_keys, opts)
return b"\x03" + name + _PACK_INT(len(data) + 5) + data + b"\x00"
Encode a mapping type.
Encode a mapping type.
Encode a mapping type .
def _encode_mapping(name, value, check_keys, opts):
    """Encode a mapping type."""
    if _raw_document_class(value):
        return b'\x03' + name + value.raw
    data = b"".join([_element_to_bson(key, val, check_keys, opts)
                     for key, val in iteritems(value)])
    return b"\x03" + name + _PACK_INT(len(data) + 5) + data + b"\x00"
def _encode_mapping ( name , value , check_keys , opts ) : if _raw_document_class ( value ) : return b'\x03' + name + value . raw data = b"" . join ( [ _element_to_bson ( key , val , check_keys , opts ) for key , val in iteritems ( value ) ] ) return b"\x03" + name + _PACK_INT ( len ( data ) + 5 ) + data + b"\x00"