Firebase安全规则:验证时间戳类型数据与请求的日期相同或迟

发布于 2025-02-02 13:02:39 字数 197 浏览 6 评论 0原文

我想验证时间戳类型数据是否与请求的日期相同或迟到。

我以这种方式写了规则。

task.due_date.date() >= request.time.date()

如果日期是将来的日期,则可以正常工作。

但是,如果日期与请求的日期相同,则无法书写。

规则应该如何编写?

I want to verify if the Timestamp type data is the same or later than the requested date.

I wrote rules in this way.

task.due_date.date() >= request.time.date()

If the date is in the future than the requested date, it works fine.

However, if the date is the same as the date of the request, it cannot be written.

How should the rules be written?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

家住魔仙堡 2025-02-09 13:02:39

假设task一个本地变量,并且有效,并且具有有效的due_date字段...

task.due_date.toMillis() >= request.time.toMillis()

Assuming task a local variable and is valid and has a valid due_date field...

task.due_date.toMillis() >= request.time.toMillis()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文