def as_doc(self):
        """Get the SON document representation of this DBRef.

        Generally not needed by application developers
        """
        doc = SON([("$ref", self.collection),
                   ("$id", self.id)])
        if self.database is not None:
            doc["$db"] = self.database
        doc.update(self.__kwargs)
        return doc
Get the SON document representation of this DBRef.

        Generally not needed by application developers
        
stackoverflow/venv/lib/python3.6/site-packages/bson/dbref.py