我就是从这个问题来的。我想过开始对它进行赏金,因为它已经几个月没有受到任何关注,而且随着时间的推移我没有看到任何答案,但我认为我的愿望有点不同。
如果有一个数字作为文档的字段,但指定为 a string:
Firestore 规则出现问题。
像这样的检查变得不可能:
resource.data.number > 11
Run Code Online (Sandbox Code Playgroud)
不可能像比较int那样比较字符串。
模拟器异常如下:
Unsupported operation error. Received: string > int. Expected: constraint > constraint, int > int, float > float, duration > duration, timestamp > timestamp, constraint > any, any > constraint.
Run Code Online (Sandbox Code Playgroud)
有没有办法将我的操作转换为int > int?