# API

### Docs moved to [https://react-firebase-js.com/docs/react-firestore-database/api](https://react-firebase-js.com/docs/react-firestore-database/getting-started)

###

### FirestoreProvider Props

| Name              | Type                                               | Required | Default |
| ----------------- | -------------------------------------------------- | -------- | ------- |
| firebase          | [firebase](https://www.npmjs.com/package/firebase) | yes      |         |
| authDomain        | string                                             | yes      |         |
| apiKey            | string                                             | yes      |         |
| databaseURL       | string                                             | yes      |         |
| projectId         | string                                             | yes      |         |
| messagingSenderId | string                                             | no       |         |
| storageBucket     | string                                             | no       |         |
| children          | React Node                                         | no       |         |
| render            | () => ReactNode                                    | no       |         |

### [Firestore Setup Reference](https://firebase.google.com/docs/firestore/quickstart)

### FirestoreCollection

| Name               | Type                                                   | Required | Default   |
| ------------------ | ------------------------------------------------------ | -------- | --------- |
| path               | string                                                 | yes      | null      |
| **where**          | {}                                                     | no       | null      |
| **where**.field    | string                                                 | no       | undefined |
| **where**.operator | "<" \| "<=" \| "==" \| ">" \| ">=" \| "array-contains" | no       | undefined |
| **where**.value    | any                                                    | no       | undefined |
| orderBy            | { field: string; type?: "desc" \| "asc" }\[]           | no       | null      |
| limit              | number                                                 | no       | null      |
| startAt            | PrimitiveType \| PrimitiveType\[] \| DocumentSnapshot  | no       | null      |
| endAt              | PrimitiveType \| DocumentSnapshot                      | no       | null      |
| startAfter         | PrimitiveType \| DocumentSnapshot                      | no       | null      |
| endBefore          | PrimitiveType \| DocumentSnapshot                      | no       | null      |

### [Firestore Query Reference](https://firebase.google.com/docs/firestore/query-data/get-data)

### FirestoreDocument

Same props as FirestoreCollection&#x20;

| Name               | Type                                                   | Required | Default   |
| ------------------ | ------------------------------------------------------ | -------- | --------- |
| path               | string                                                 | yes      | null      |
| **where**          | {}                                                     | no       | null      |
| **where**.field    | string                                                 | no       | undefined |
| **where**.operator | "<" \| "<=" \| "==" \| ">" \| ">=" \| "array-contains" | no       | undefined |
| **where**.value    | any                                                    | no       | undefined |
| orderBy            | { field: string; type?: "desc" \| "asc" }\[]           | no       | null      |
| limit              | number                                                 | no       | null      |
| startAt            | PrimitiveType \| PrimitiveType\[] \| DocumentSnapshot  | no       | null      |
| endAt              | PrimitiveType \| DocumentSnapshot                      | no       | null      |
| startAfter         | PrimitiveType \| DocumentSnapshot                      | no       | null      |
| endBefore          | PrimitiveType \| DocumentSnapshot                      | no       | null      |

### [Firestore Query Reference](https://firebase.google.com/docs/firestore/query-data/get-data)

### FirestoreMutation Props​ <a href="#firebasedatabasemutation-props" id="firebasedatabasemutation-props"></a>

| Name     | Type                                                                                  | Required | Default |
| -------- | ------------------------------------------------------------------------------------- | -------- | ------- |
| path     | string                                                                                | yes      | ​       |
| type     | "set" \| "update" \| "add"                                                            | yes      | ​       |
| children | ( { runMutation: (value:any, options?:any) => Promise<{key?:string}> } ) => ReactNode | yes      | null    |

### [​Firestore Write Data Reference​](https://firebase.google.com/docs/firestore/manage-data/add-data) <a href="#firebase-write-data-reference" id="firebase-write-data-reference"></a>
