且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Firestore规则:当数据为数字时,条件检查失败

更新时间:2023-02-16 20:35:10

万一将来有人遇到这种情况,请查看以下有关在Firestore规则中转换数据类型的文档:

In case anyone runs into this in the future, check out these docs on converting data types in the Firestore rules:

字符串->整数

整数->字符串

示例:

int("2") == 2
int(2.0) == 2

string(true) == "true"
string(1) == "1"
string(2.0) == "2.0"
string(null) == "null"