← HY Studio

ルールが参照するドキュメントは、書き込み順序を決めるWhat your Firestore rules read decides your write order

Flutter / Cloud Firestore / 2026年8月Flutter / Cloud Firestore — August 2026

記録(Markdown・そのまま使えます)The notes (Markdown, ready to use)

GitHub で開く.md をダウンロード Open on GitHubDownload the .md

何の話かWhat this is about

Firestore のセキュリティルールで exists()get() を使うと、そのドキュメントは他と対等ではなくなります。後続の読み書きすべての前提になり、並列に扱えなくなります。

エラーは PERMISSION_DENIED としか出ないので、ルールの書き方を疑って時間を使うことになります。ルールは正しく、順序だけが違います。

Using exists() or get() in your Firestore rules means that document is no longer a peer of the others. It becomes a precondition for every read and write that follows, and can no longer be written in parallel.

The only error is PERMISSION_DENIED, so you spend your time rereading the rules. The rules are correct. Only the order is wrong.

書いてあることWhat it covers

引用・転載・改変 自由Quote, republish, and modify freely HY Studio