-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfirebase.json
32 lines (32 loc) · 1.21 KB
/
firebase.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
"rules": {
"userStatus": {
".indexOn": ["isOnline", "updatedAt"],
".read": "(query.orderByChild == 'updatedAt' && query.limitToLast <= 1000) ||
(query.orderByChild == 'isOnline' && query.equalTo == true)",
"$userId": {
".read": "true",
".write": "true",
".validate": "newData.hasChildren(['name', 'isOnline', 'updatedAt']) &&
newData.child('name').isString() &&
newData.child('name').val().length >= 2 &&
newData.child('name').val().length <= 50 &&
newData.child('isOnline').isBoolean() &&
newData.child('updatedAt').val() === now"
}
},
"typingStatus": {
".read": "true",
".indexOn": ["isTyping"],
"$userId": {
".write": "true",
".validate": "newData.hasChildren(['name', 'isTyping', 'updatedAt']) &&
newData.child('name').isString() &&
newData.child('name').val().length >= 2 &&
newData.child('name').val().length <= 50 &&
newData.child('isTyping').isBoolean() &&
newData.child('updatedAt').val() === now"
}
}
}
}