I see that there is no way to set security rules as preventing \"delete and update\" for a child.
\".write\": \"!data.exists() && newData.exists() &a
For future reference, the Firebase console lets you test database security rules, so you can find out what works right there before you publish those rules. That being said, if I'm understanding your question correctly, you want to allow users to add to the node, but not delete or update. You'd be looking for something along the lines of:
{
"rules": {
...
"childNodeName": {
".write": "!data.exists()"
}
}
}
You shouldn't need those other two conditions. Not to mention, they will never resolve to true since those conditions cannot be met.
You can also use a wildcard if you need to add multiple children to a path but you don't want the user to modify those children once they've been added:
{
"rules": {
...
"childNodeName": {
"$pushId": {
".write": "!data.exists()"
}
}
}
}