简体   繁体   English

firebase安全规则中的理解(root)

[英]Understanding (root) in firebase security rules

From what I understand root.child(...) in firebase security rules represents the old data at the child.据我了解,firebase 安全规则中的root.child(...)代表孩子的old data

Lets say multiple users A,B,C,D updated the same child node together.假设多个用户 A、B、C、D 一起更新了同一个子节点。

Server gets them likes this:服务器得到他们喜欢这样:

  1. A first.第一个。
  2. B next.下一个。
  3. C next. C 下一个。
  4. D next. D 接下来。

My Question:我的问题:

When B is processed. B处理时。 Shouldn't root hold the data that was updated by A? root不应该持有 A 更新的数据吗?

If you send these as a single write operation, they are processed atomically so they are either all applied in one go or none of them are applied.如果您将它们作为单个写入操作发送,它们将以原子方式处理,因此它们要么在一个 go 中全部应用,要么都不应用。 The root will not be updated until they are all applied, so only for the next write operation you send.在它们全部应用之前不会更新root ,因此仅针对您发送的下一个写操作。

If you require an explicit ordering of the write operation, send them as separate write operations to the database.如果您需要写操作的明确顺序,请将它们作为单独的写操作发送到数据库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM