@property
    def document(self):
        if self.__tag_sets in (None, [{}]):
            return {'mode': self.__mongos_mode}
        return {'mode': self.__mongos_mode, 'tags': self.__tag_sets}
Read preference as a document.
dataset/ETHPy150Open mongodb/mongo-python-driver/pymongo/read_preferences.py/_ServerMode.document