RethinkDB - Python - 检查表中是否存在数据

问题描述 投票:0回答:1

我想知道是否有更简单的方法来检查数据是否在表格中。目前我不得不使用

users = r.db("main").table("users").filter(r.row['user'] == int(msg.author.id)).run()

for user in blacklist:
    if users['user'] == msg.author.id:
        return # this happens if the user sending a message was found

由于用户的反应是重新考虑的数据光标,我不得不使用它

<rethinkdb.net.DefaultCursor object at 0x0512C0B0> (done streaming):

所以它不像我可以使用

data has item

谢谢

python database rethinkdb
1个回答
0
投票

解决了,忘记了python中的list方法所以我所要做的就是

data = list(r.db(“database”)。table(“table”)。run())

© www.soinside.com 2019 - 2024. All rights reserved.