# Firestore

[\
https://firebase.google.com/docs/firestore/quickstart](<&#xA;https://firebase.google.com/docs/firestore/quickstart>)

<https://medium.com/get-it-working/get-googles-firestore-working-with-react-c78f198d2364>

<https://firebase.google.com/docs/firestore/security/get-started>

```javascript
// Allow read/write access on all documents to any user signed in to the application
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if request.auth.uid != null;
    }
  }
}
```

`allow read, write: if request.auth.uid != null;`

```javascript
service cloud.firestore {
  match /databases/{database}/documents {
    // Make sure the uid of the requesting user matches name of the user
    // document. The wildcard expression {userId} makes the userId variable
    // available in rules.
    match /users/{userId} {
      allow read, update, delete: if request.auth.uid == userId;
      allow create: if request.auth.uid != null;
    }
  }
}
```

<https://firebase.google.com/docs/firestore/security/rules-conditions>

<https://firebase.google.com/docs/firestore/security/rules-query>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://textav.gitbook.io/firebase-react-notes/firestore/firestore.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
