我正在嘗試從數據庫中讀取數據庫中消息的不同“線程”,但是每次嘗試時,我都會返回一個空數組,這使我認為請求所有線程時出了點問題使用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]
getAll什么都不返回?重新思考數據庫
慕的地6264312
2021-03-29 12:44:48
