{"id":12557,"date":"2025-06-10T10:49:17","date_gmt":"2025-06-10T10:49:17","guid":{"rendered":"https:\/\/www.bacancytechnology.com\/qanda\/?p=12557"},"modified":"2025-06-10T10:50:40","modified_gmt":"2025-06-10T10:50:40","slug":"use-logical-or-operator-in-firebase-firestore-security-rules","status":"publish","type":"post","link":"https:\/\/www.bacancytechnology.com\/qanda\/cloud\/use-logical-or-operator-in-firebase-firestore-security-rules","title":{"rendered":"Unable to Use the Logical OR Operator in Firebase Firestore Security Rules"},"content":{"rendered":"<p>It is kind of security for the Firestore database.<br \/>\nIt will control who can access,read,write or edit data on the Firebase Datastore.<br \/>\nWe need to define rules for authorisation on who can access it.<br \/>\nIt is for keeping crucial data safe.<\/p>\n<h3>Example script:<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dockerfile\">service cloud.firestore {\r\n  match \/databases\/{database}\/documents {\r\n    match \/collection\/{document} {\r\n      allow read, write: if &lt;condition&gt;;\r\n    }\r\n\r\n  }\r\n}\r\n<\/pre>\n<p>&nbsp;<br \/>\n-> service cloud.firestore: Specifies that these rules are for Firestore.<br \/>\n-> match \/databases\/{database}\/documents: Targets your Firestore database.<br \/>\n-> match \/collection\/{document}: Targets a specific collection or document.<br \/>\n-> allow read, write: if <condition>: Grants access if the condition is true.<\/p>\n<div class=\"qanda-read-box\"><div class=\"bg-light read-more-icon\"><img decoding=\"async\" src=\"https:\/\/assets.bacancytechnology.com\/qanda\/wp-content\/uploads\/2025\/04\/24061434\/read-txt.png\" alt=\"Also Read\"><p><\/p><h3>Also Read:<\/h3><a href=\"https:\/\/www.bacancytechnology.com\/blog\/cloud-maturity-model\" target=\"_blank\">Cloud Maturity Model<\/a><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>It is kind of security for the Firestore database. It will control who can access,read,write or edit data on the Firebase Datastore. We need to define rules for authorisation on who can access it. It is for keeping crucial data safe. Example script: service cloud.firestore { match \/databases\/{database}\/documents { match \/collection\/{document} { allow read, write: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":12558,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[17],"tags":[],"class_list":["post-12557","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/12557"}],"collection":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/comments?post=12557"}],"version-history":[{"count":2,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/12557\/revisions"}],"predecessor-version":[{"id":12560,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/12557\/revisions\/12560"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/media\/12558"}],"wp:attachment":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/media?parent=12557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/categories?post=12557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/tags?post=12557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}