Skip to content

Instantly share code, notes, and snippets.

@GirlBossRush
Created December 28, 2014 05:40
Show Gist options
  • Save GirlBossRush/e238575a2a51e968cb58 to your computer and use it in GitHub Desktop.
Save GirlBossRush/e238575a2a51e968cb58 to your computer and use it in GitHub Desktop.
{
"rules": {
"stories": {
".read": true,
"$id": {
".read": true,
".write": true,
".validate": "newData.hasChildren(['updatedAt'])",
"body": {
".validate": "newData.isString()"
},
"title": {
".validate": "newData.isString() &&
newData.val().length <= 100"
},
"description": {
".validate": "newData.isString() &&
newData.val().length <= 2000"
},
"updatedAt": {
".validate": "newData.isNumber() &&
newData.val() <= now"
},
"createdAt": {
".validate": "newData.isNumber() &&
newData.val() <= now"
},
"$other": {
".validate": false
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment