'Get the SON document representation of this DBRef.
Generally not needed by application developers'

def as_doc(self):

    doc = SON([('$ref', self.collection), ('$id', self.id)])
    if (self.database is not None):
        doc['$db'] = self.database
    doc.update(self.__kwargs)
    return doc
