MongoDB:检查集合中的值是 true 还是 false

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

我正在为我的游戏制作一个 FFlag 系统,我正在使用 MongoDB。我想检查这个集合中的某个值是真还是假。这是我的代码:

if FFlagsData:FindOne({["allowRebirthing"] = true }) then
    print("Test1")
else if FFlagsData:FindOne({["allowRebirthing"] = false }) then
        print("Test2")
    end
end

image of my collection

mongodb lua roblox
1个回答
0
投票

尝试以下代码片段:

if FFlagsData:FindOne({allowRebirthing : true }) then
    print("Test1")
else if FFlagsData:FindOne({allowRebirthing : false }) then
        print("Test2")
    end
end

希望它有效。

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