我的问题是
我想根据MongoDB上是否有数据采取行动
如果没有数据,我希望它用输入法输入数据,如果它以前输入过数据,我希望它继续
我写了一个这样的代码,但它不起作用:
okulvarmi = { "okul" }
okul = db.find(okulvarmi)
if okul == "null":
print("No data is included. Please add.")
else:
print("The data has already been added. You can continue the transaction.")
上面的代码不起作用
我该怎么做我说的系统
“okul”变量的值为“null”,因此它是一个字符串
因此,最好尝试以下方法:
相关问题 更多 >
编程相关推荐