在Python中创建'if'语句时,我们可以选择使用if boolean:
,而无需进行显式比较(这不是强制性的)
问题是:在这种情况下,默认的比较是什么? if x:
等于if x == True
或if x is True
吗?
答案 0 :(得分:-2)
不确定我是否理解您的问题,但是您可以使用:
while True:
#do whatever here and it will loop infinitely
将一次返回“ hi”
如果您想进行无限循环,请尝试以下操作:
Data.findOneAndUpdate({ userID: user.id },
{ $set: { language: args[2], email: args[1] } },
{ new: true }).exec((err, data) => {
//further response with updated data
});