(doc)
return ObjectId(doc['$oid'])
Decode a JSON ObjectId to bson.objectid.ObjectId.
Decode a JSON ObjectId to bson.objectid.ObjectId.
Decode a JSON ObjectId to bson . objectid . ObjectId .
def _parse_canonical_oid(doc):
    """Decode a JSON ObjectId to bson.objectid.ObjectId."""
    if len(doc) != 1:
        raise TypeError('Bad $oid, extra field(s): %s' % (doc,))
    return ObjectId(doc['$oid'])
def _parse_canonical_oid ( doc ) : if len ( doc ) != 1 : raise TypeError ( 'Bad $oid, extra field(s): %s' % ( doc , ) ) return ObjectId ( doc [ '$oid' ] )