강의

멘토링

커뮤니티

인프런 커뮤니티 질문&답변

do wang님의 프로필 이미지
do wang

작성한 질문수

따라하며 배우는 리액트, 파이어베이스 - 채팅 어플리케이션 만들기[2023.12 리뉴얼]

Firebase 데이터베이스 규칙 (2)

unexpected EOF.

작성

·

378

0

이런 오류가 발생 합니다 ㅠ 

잘못 쓴게 있나 유심히 봐도 보이지가 않습니다 

{
  "rules": {
    "chatRooms" : {
      ".read" : "auth != null",
        "&chatRoomId" : {
          ".write" : "auth != null",
          ".validate" : "newData.hasChildren(['id','name', 'createdBy', 'description'])",
          "id": {
            ".validate" : "newData.val() === $chatRoomId"
          },
          "name" : {
            ".validate" : "newData.val().length > 0"
          },
          "description" :{
          	".validate" : "newData.val().length > 0"
          }
        }
    },
      "messages" : {
					".read" : "auth !== null",
            ".write" : "auth !== null",
        	"content": {
            ".validate" : "newData.val().length >0"
          },
          "image" : {
            ".validate" : "newData.val().length >0"
          },
          "user" : {
            ".validate" : "newData.hasChildren(['id','image','name'])"
          }
      },
        "presence" : {
          ".read": "auth != null",
          ".write" : "auth != null"
        },
        "typing" : {
           ".read": "auth != null",
           ".write": "auth != null"
        },
        "users" :{
          ".read" : "auth != null",
          "$uid" : {
            ".write" : "auth != null && auth.uid === $uid",
            ".validate" : "newData.hasChildren(['name','image'])",
            "name" : {
              ".validate" :"newData.val().length > 0"
            },
            "image": {
							".validate" : "newData.val().length > 0"
          }
        }
  	}
  }

답변 1

0

John Ahn님의 프로필 이미지
John Ahn
지식공유자

안녕하세요 !

마지막에 } 이거를 하나 더 넣어주실래요 ? ! 

do wang님의 프로필 이미지
do wang

작성한 질문수

질문하기