我正在尝试从数据库中读取数据库中消息的不同“线程”,但是每次尝试时,我都会返回一个空数组,这使我认为请求所有线程时出了点问题使用get_all命令。像这样从数据库请求是正确的吗?根本没有错误,所以我很困惑,因为它应该返回消息的线程。
def threads(cls, clinic_id, db={}):
"""Threads
Returns the unique list of threads in the SMS log
Arguments:
clinic_id {uint} -- The unique ID of the clinic
db {dict} -- Optional DB info
Returns:
list
"""
# Get the info
dInfo = cls.info(db)
# Connect to the server
with connect_with(dInfo['server']) as oCon:
# Request all threads
itRes = r \
.db(dInfo['db']) \
.table(dInfo['tree']._name) \
.get_all([clinic_id, r.minval], [clinic_id, r.maxval], index="clinic_number") \
.pluck(['number']) \
.default(None) \
.distinct() \
.run(oCon)
# Return the list of numbers
return [d['number'] for d in itRes]
慕标5832272
相关分类