2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Firebaseのデータベースで複数のデータを読まないように制限をかけたい

Last updated at Posted at 2018-12-04
  • 下記の例は trees配下のappleを複数同時に読むことを禁止し、IDを指定すると個別に読むことを許可している。
{
  "rules": {
    ".read": false,
    ".write": false, 
    "trees": {
        ".read": false,
        ".write": false,
        "$tree_id" : {
            ".read": true, 
            "apples" : {
                ".read": false,  // 複数を同時読み込みを禁止
                "$apple_id": {
                  ".read": true  // appleのIDを指定すると1件ずつ読込できる。
                }
             }
        }
    }
}
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?