def _parse_canonical_int64 ( doc ) : l_str = doc [ '$numberLong' ] if len ( doc ) != 1 : raise TypeError ( 'Bad $numberLong, extra field(s): %s' % ( doc , ) ) return Int64 ( l_str )
python conver mongo number long to int
Decode a JSON int64 to bson . int64 . Int64 .
def _parse_canonical_int64(doc):
    """Decode a JSON int64 to bson.int64.Int64."""
    l_str = doc['$numberLong']
    if len(doc) != 1:
        raise TypeError('Bad $numberLong, extra field(s): %s' % (doc,))
    return Int64(l_str)