我正在嘗試從數(shù)據(jù)庫中讀取數(shù)據(jù)庫中消息的不同“線程”,但是每次嘗試時(shí),我都會(huì)返回一個(gè)空數(shù)組,這使我認(rèn)為請求所有線程時(shí)出了點(diǎn)問題使用get_all命令。像這樣從數(shù)據(jù)庫請求是正確的嗎?根本沒有錯(cuò)誤,所以我很困惑,因?yàn)樗鼞?yīng)該返回消息的線程。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]
getAll什么都不返回?重新思考數(shù)據(jù)庫
慕的地6264312
2021-03-29 12:44:48