Skip to content

Glossary: Firebase and Supabase

affectedKeys()

Also written: diff, hasOnly

Rules functions used together: `diff` compares the incoming document with the stored one, `affectedKeys()` lists the fields that would change, and `hasOnly([...])` checks that only the listed fields are among them. Kettle & Crane uses this so members can change `name` and `city` but never `stamps`.

Where the book teaches it

Related terms

security rulesresource.data, request.resource.data