# functional-firestore

> Google Cloud Firestore Utilities functions in Functional Programming

Latest version **0.6.7** (published 2020-04-21) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install functional-firestore
pnpm add functional-firestore
yarn add functional-firestore
bun add functional-firestore
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.6.7 |
| Published | 2020-04-21 |
| First published | 2020-01-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 99.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | carneyc |
| Maintainers | carneyc |
| Keywords | firestore, typescript, functional-programming |

## Links

- npm: https://www.npmjs.com/package/functional-firestore
- npm.io page: https://npm.io/package/functional-firestore

## Dependencies (6)

- [fp-ts](https://npm.io/package/fp-ts.md) ^2.5.3
- [ramda](https://npm.io/package/ramda.md) ^0.27.0
- [functional-fp-ts](https://npm.io/package/functional-fp-ts.md) 0.0.1
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13
- [source-map-support](https://npm.io/package/source-map-support.md) ^0.5.17
- [@google-cloud/firestore](https://npm.io/package/@google-cloud/firestore.md) ^3.7.4

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.6.7 (latest) — 2020-04-21
- 0.6.6 — 2020-04-21
- 0.6.5 — 2020-04-21
- 0.6.4 — 2020-04-21
- 0.6.3 — 2020-04-21
- 0.6.2 — 2020-04-21
- 0.6.1 — 2020-04-20
- 0.6.0 — 2020-04-20
- 0.5.5 — 2020-04-20
- 0.5.4 — 2020-03-10
- 0.5.3 — 2020-03-06
- 0.5.2 — 2020-03-03
- 0.5.1 — 2020-03-02
- 0.5.0 — 2020-02-27
- 0.4.2 — 2020-01-24
- … 15 more at https://npm.io/package/functional-firestore/versions

## README

<a name="globalsmd"></a>

[functional-firestore](#globalsmd)

# functional-firestore

## Index

### Modules

* ["Arbitraries"](#modules_arbitraries_md)
* ["Emulator"](#modules_emulator_md)
* ["Firestore"](#modules_firestore_md)
* ["index"](#modules_index_md)


<a name="readmemd"></a>

[functional-firestore](#globalsmd)

# functional-firestore


# Modules


<a name="modules_arbitraries_md"></a>

[functional-firestore](#globalsmd) › ["Arbitraries"](#modules_arbitraries_md)

## Module: "Arbitraries"

### Index

#### Functions

* [condition](#const-condition)
* [id](#const-id)
* [model](#const-model)
* [modelAndConditions](#const-modelandconditions)
* [modelAndUpdate](#const-modelandupdate)
* [modelBase](#const-modelbase)
* [modelData](#const-modeldata)
* [models](#const-models)
* [nonEmptyString](#const-nonemptystring)
* [nonModelObject](#const-nonmodelobject)
* [operation](#const-operation)
* [table](#const-table)

### Functions

#### `Const` condition

▸ **condition**(): *Arbitrary‹[Condition](#condition)›*

Defined in src/Arbitraries.ts:40

**Returns:** *Arbitrary‹[Condition](#condition)›*

___

#### `Const` id

▸ **id**(): *Arbitrary‹string›*

Defined in src/Arbitraries.ts:7

**Returns:** *Arbitrary‹string›*

___

#### `Const` model

▸ **model**(): *Arbitrary‹[Model](#model)›*

Defined in src/Arbitraries.ts:24

**Returns:** *Arbitrary‹[Model](#model)›*

___

#### `Const` modelAndConditions

▸ **modelAndConditions**(): *Arbitrary‹[[Model](#model), [Condition](#condition)[]]›*

Defined in src/Arbitraries.ts:43

**Returns:** *Arbitrary‹[[Model](#model), [Condition](#condition)[]]›*

___

#### `Const` modelAndUpdate

▸ **modelAndUpdate**(): *Arbitrary‹[[Model](#model), [Model](#model)]›*

Defined in src/Arbitraries.ts:29

**Returns:** *Arbitrary‹[[Model](#model), [Model](#model)]›*

___

#### `Const` modelBase

▸ **modelBase**(): *Arbitrary‹[Model](#model)›*

Defined in src/Arbitraries.ts:12

**Returns:** *Arbitrary‹[Model](#model)›*

___

#### `Const` modelData

▸ **modelData**(): *Arbitrary‹object›*

Defined in src/Arbitraries.ts:17

**Returns:** *Arbitrary‹object›*

___

#### `Const` models

▸ **models**(): *Arbitrary‹[Model](#model)[]›*

Defined in src/Arbitraries.ts:57

**Returns:** *Arbitrary‹[Model](#model)[]›*

___

#### `Const` nonEmptyString

▸ **nonEmptyString**(): *Arbitrary‹string›*

Defined in src/Arbitraries.ts:5

**Returns:** *Arbitrary‹string›*

___

#### `Const` nonModelObject

▸ **nonModelObject**(): *Arbitrary‹unknown›*

Defined in src/Arbitraries.ts:9

**Returns:** *Arbitrary‹unknown›*

___

#### `Const` operation

▸ **operation**(): *Arbitrary‹[Operation](#operation)›*

Defined in src/Arbitraries.ts:38

**Returns:** *Arbitrary‹[Operation](#operation)›*

___

#### `Const` table

▸ **table**(): *Arbitrary‹string›*

Defined in src/Arbitraries.ts:59

**Returns:** *Arbitrary‹string›*


<a name="modules_emulator_md"></a>

[functional-firestore](#globalsmd) › ["Emulator"](#modules_emulator_md)

## Module: "Emulator"

### Index

#### Functions

* [clearCollection](#const-clearcollection)
* [clearEmulator](#const-clearemulator)
* [clearFirestore](#const-clearfirestore)
* [getFirestore](#const-getfirestore)

### Functions

#### `Const` clearCollection

▸ **clearCollection**(`parentCollection`: CollectionReference‹object›): *Promise‹void›*

Defined in src/Emulator.ts:25

```haskell
clearCollection :: Collection -> Promise
```

**Parameters:**

Name | Type |
------ | ------ |
`parentCollection` | CollectionReference‹object› |

**Returns:** *Promise‹void›*

___

#### `Const` clearEmulator

▸ **clearEmulator**(): *Promise‹void›*

Defined in src/Emulator.ts:56

```haskell
clearFirebase :: () -> Promise
```

**Returns:** *Promise‹void›*

___

#### `Const` clearFirestore

▸ **clearFirestore**(): *Promise‹void›*

Defined in src/Emulator.ts:46

```haskell
clearFirestore :: () -> Promise
```

**Returns:** *Promise‹void›*

___

#### `Const` getFirestore

▸ **getFirestore**(): *Firestore‹›*

Defined in src/Emulator.ts:16

```haskell
getFirestore :: () -> Firestore
```

**Returns:** *Firestore‹›*


<a name="modules_firestore_md"></a>

[functional-firestore](#globalsmd) › ["Firestore"](#modules_firestore_md)

## Module: "Firestore"

### Index

#### Type aliases

* [Condition](#condition)
* [DateModel](#datemodel)
* [Model](#model)
* [Operation](#operation)
* [SerializedModel](#serializedmodel)
* [TimestampModel](#timestampmodel)

#### Variables

* [getDocumentSnapshotsFromQuerySnapshot](#const-getdocumentsnapshotsfromquerysnapshot)
* [getModelFromCollection](#const-getmodelfromcollection)
* [getModelFromDocument](#const-getmodelfromdocument)
* [getModelFromFirestore](#const-getmodelfromfirestore)
* [getModelsFromQuery](#const-getmodelsfromquery)
* [getModelsFromQuerySnapshot](#const-getmodelsfromquerysnapshot)
* [getModelsInCollection](#const-getmodelsincollection)
* [getModelsInCollectionWhere](#const-getmodelsincollectionwhere)
* [getModelsInFirestore](#const-getmodelsinfirestore)
* [getModelsInFirestoreWhere](#const-getmodelsinfirestorewhere)
* [getSnapshotFromDocument](#const-getsnapshotfromdocument)
* [getSnapshotFromQuery](#const-getsnapshotfromquery)
* [serialize](#const-serialize)
* [serializeTimestampModel](#const-serializetimestampmodel)
* [storeModelToCollection](#const-storemodeltocollection)
* [storeModelToDocument](#const-storemodeltodocument)
* [storeModelToFirestore](#const-storemodeltofirestore)
* [updateModelInDocument](#const-updatemodelindocument)
* [validateModel](#const-validatemodel)
* [validateSnapshotExistence](#const-validatesnapshotexistence)

#### Functions

* [fromDateModel](#const-fromdatemodel)
* [fromTimestampModel](#const-fromtimestampmodel)
* [getCollectionFromDocument](#const-getcollectionfromdocument)
* [getCollectionFromFirestore](#const-getcollectionfromfirestore)
* [getDocumentFromCollection](#const-getdocumentfromcollection)
* [getQueryFromCollection](#const-getqueryfromcollection)
* [getSnapshotFromDocumentTask](#const-getsnapshotfromdocumenttask)
* [getSnapshotFromQueryTask](#const-getsnapshotfromquerytask)
* [isDateModel](#const-isdatemodel)
* [isDateString](#const-isdatestring)
* [isModel](#const-ismodel)
* [isSerializedModel](#const-isserializedmodel)
* [isTimestampModel](#const-istimestampmodel)
* [listCollectionsInFirestore](#const-listcollectionsinfirestore)
* [listDocumentsInCollection](#const-listdocumentsincollection)
* [serializeDateModel](#const-serializedatemodel)
* [storeModelToFirestoreWith](#const-storemodeltofirestorewith)
* [updateModelInDocumentTask](#const-updatemodelindocumenttask)

### Type aliases

####  Condition

Ƭ **Condition**: *[string, [Operation](#operation), unknown]*

Defined in src/Firestore.ts:57

___

####  DateModel

Ƭ **DateModel**: *[Model](#model)‹A› & object*

Defined in src/Firestore.ts:45

___

####  Model

Ƭ **Model**: *object & A*

Defined in src/Firestore.ts:36

___

####  Operation

Ƭ **Operation**: *WhereFilterOp*

Defined in src/Firestore.ts:55

___

####  SerializedModel

Ƭ **SerializedModel**: *[Model](#model)‹A› & object*

Defined in src/Firestore.ts:50

___

####  TimestampModel

Ƭ **TimestampModel**: *[Model](#model)‹A› & object*

Defined in src/Firestore.ts:40

### Variables

#### `Const` getDocumentSnapshotsFromQuerySnapshot

• **getDocumentSnapshotsFromQuerySnapshot**: *function* = prop('docs')

Defined in src/Firestore.ts:516

```haskell
getDocumentSnapshotsFromQuerySnapshot :: QuerySnapshot -> [DocumentSnapshot]
```

##### Type declaration:

▸ (`snapshot`: QuerySnapshot): *QueryDocumentSnapshot[]*

**Parameters:**

Name | Type |
------ | ------ |
`snapshot` | QuerySnapshot |

___

#### `Const` getModelFromCollection

• **getModelFromCollection**: *function* = pipe(
  getSnapshotFromCollection,
  RTE.chainEitherK(getModelFromDocumentSnapshot)
)

Defined in src/Firestore.ts:436

```haskell
getModelFromCollection :: Collection -> ReaderTaskEither Model Model Error
```

##### Type declaration:

▸ (`collection`: CollectionReference): *ReaderTaskEither‹[Model](#model), Error, [Model](#model)›*

**Parameters:**

Name | Type |
------ | ------ |
`collection` | CollectionReference |

___

#### `Const` getModelFromDocument

• **getModelFromDocument**: *function* = pipe(
  getSnapshotFromDocument,
  TE.chainEitherK(getModelFromDocumentSnapshot)
)

Defined in src/Firestore.ts:482

```haskell
getModelFromDocument :: Document -> TaskEither Model Error
```

##### Type declaration:

▸ (`document`: DocumentReference): *TaskEither‹Error, [Model](#model)›*

**Parameters:**

Name | Type |
------ | ------ |
`document` | DocumentReference |

___

#### `Const` getModelFromFirestore

• **getModelFromFirestore**: *function* = pipe(
  getCollectionFromFirestore,
  R.map(getModelFromCollection)
)

Defined in src/Firestore.ts:448

```haskell
getModelFromFirestore :: Firestore -> Reader String (ReaderTaskEither Model Model Error)
```

##### Type declaration:

▸ (`firestore`: Firestore): *Reader‹string, ReaderTaskEither‹[Model](#model), Error, [Model](#model)››*

**Parameters:**

Name | Type |
------ | ------ |
`firestore` | Firestore |

___

#### `Const` getModelsFromQuery

• **getModelsFromQuery**: *function* = pipe(
  getSnapshotFromQuery,
  TE.chainEitherK(getModelsFromQuerySnapshot)
)

Defined in src/Firestore.ts:538

```haskell
getModelsFromQuery :: Query -> TaskEither [Model] Error
```

##### Type declaration:

▸ (`query`: Query): *TaskEither‹Error, [Model](#model)[]›*

**Parameters:**

Name | Type |
------ | ------ |
`query` | Query |

___

#### `Const` getModelsFromQuerySnapshot

• **getModelsFromQuerySnapshot**: *function* = pipe(
  getDocumentSnapshotsFromQuerySnapshot,
  map(getModelFromDocumentSnapshot),
  A.array.sequence(E.either)
)

Defined in src/Firestore.ts:525

```haskell
getModelsFromQuerySnapshot :: QuerySnapshot -> Either [Model] Error
```

##### Type declaration:

▸ (`snapshot`: QuerySnapshot): *E.Either‹Error, [Model](#model)[]›*

**Parameters:**

Name | Type |
------ | ------ |
`snapshot` | QuerySnapshot |

___

#### `Const` getModelsInCollection

• **getModelsInCollection**: *function* = pipe(
  listDocumentsInCollection,
  TEUtils.fromTask,
  TE.chain(pipe(map(getModelFromDocument), A.array.sequence(TE.taskEither)))
)

Defined in src/Firestore.ts:575

```haskell
getModelsInCollection :: Collection -> TaskEither [Model] Error
```

##### Type declaration:

▸ (`collection`: CollectionReference): *TaskEither‹Error, [Model](#model)[]›*

**Parameters:**

Name | Type |
------ | ------ |
`collection` | CollectionReference |

___

#### `Const` getModelsInCollectionWhere

• **getModelsInCollectionWhere**: *function* = pipe(
  getQueryFromCollection,
  RTE.fromReaderEither,
  RTE.chainTaskEitherK(getModelsFromQuery)
)

Defined in src/Firestore.ts:550

```haskell
getModelsInCollectionWhere :: Collection -> ReaderTaskEither [Condition] [Model] Error
```

##### Type declaration:

▸ (`collection`: CollectionReference): *ReaderTaskEither‹[Condition](#condition)[], Error, [Model](#model)[]›*

**Parameters:**

Name | Type |
------ | ------ |
`collection` | CollectionReference |

___

#### `Const` getModelsInFirestore

• **getModelsInFirestore**: *function* = pipe(
  getCollectionFromFirestore,
  R.map(getModelsInCollection)
)

Defined in src/Firestore.ts:588

```haskell
getModelsInFirestore :: Firestore -> ReaderTaskEither String [Model] Error
```

##### Type declaration:

▸ (`firestore`: Firestore): *ReaderTaskEither‹string, Error, [Model](#model)[]›*

**Parameters:**

Name | Type |
------ | ------ |
`firestore` | Firestore |

___

#### `Const` getModelsInFirestoreWhere

• **getModelsInFirestoreWhere**: *function* = pipe(
  getCollectionFromFirestore,
  R.map(getModelsInCollectionWhere)
)

Defined in src/Firestore.ts:563

```haskell
getModelsInFirestoreWhere :: Firestore -> Reader String (ReaderTaskEither [Condition] [Model] Error)
```

##### Type declaration:

▸ (`firestore`: Firestore): *Reader‹string, ReaderTaskEither‹[Condition](#condition)[], Error, [Model](#model)[]››*

**Parameters:**

Name | Type |
------ | ------ |
`firestore` | Firestore |

___

#### `Const` getSnapshotFromDocument

• **getSnapshotFromDocument**: *function* = pipe(
  getSnapshotFromDocumentTask,
  TEUtils.fromTask
)

Defined in src/Firestore.ts:366

```haskell
getSnapshotFromDocument :: Document -> TaskEither Snapshot Error
```

##### Type declaration:

▸ (`document`: DocumentReference): *TaskEither‹Error, DocumentSnapshot›*

**Parameters:**

Name | Type |
------ | ------ |
`document` | DocumentReference |

___

#### `Const` getSnapshotFromQuery

• **getSnapshotFromQuery**: *function* = pipe(
  getSnapshotFromQueryTask,
  TEUtils.fromTask
)

Defined in src/Firestore.ts:504

```haskell
getSnapshotFromQuery :: Query -> TaskEither Snapshot Error
```

##### Type declaration:

▸ (`query`: Query): *TaskEither‹Error, QuerySnapshot›*

**Parameters:**

Name | Type |
------ | ------ |
`query` | Query |

___

#### `Const` serialize

• **serialize**: *function* = ifElse(
  isSerializedModel,
  E.right,
  pipe(
    ifElse(
      isDateModel,
      E.right,
      pipe(
        E.fromPredicate(
          isTimestampModel,
          () => new Error('Model is not a TimestampModel.')
        ),
        fromTimestampModel
      )
    ),
    E.map(serializeDateModel)
  )
)

Defined in src/Firestore.ts:183

```haskell
serialize :: Model -> Either SerializedModel Error
```

##### Type declaration:

▸ <**A**>(`model`: [Model](#model)‹A›): *E.Either‹Error, [SerializedModel](#serializedmodel)‹A››*

**Type parameters:**

▪ **A**

**Parameters:**

Name | Type |
------ | ------ |
`model` | [Model](#model)‹A› |

___

#### `Const` serializeTimestampModel

• **serializeTimestampModel**: *function* = pipe(fromTimestampModel, serializeDateModel)

Defined in src/Firestore.ts:174

```haskell
serializeTimestampModel :: TimestampModel -> SerializedModel
```

##### Type declaration:

▸ <**A**>(`model`: [TimestampModel](#timestampmodel)‹A›): *[SerializedModel](#serializedmodel)‹A›*

**Type parameters:**

▪ **A**

**Parameters:**

Name | Type |
------ | ------ |
`model` | [TimestampModel](#timestampmodel)‹A› |

___

#### `Const` storeModelToCollection

• **storeModelToCollection**: *function* = pipe(
  getDocumentFromCollection,
  R.chain(storeModelToDocument)
)

Defined in src/Firestore.ts:291

```haskell
storeModelToCollection :: Collection -> String -> ReaderTaskEither Model Model Error
```

##### Type declaration:

▸ (`collection`: CollectionReference): *ReaderTaskEither‹[Model](#model), Error, [Model](#model)›*

**Parameters:**

Name | Type |
------ | ------ |
`collection` | CollectionReference |

___

#### `Const` storeModelToDocument

• **storeModelToDocument**: *function* = pipe(
  storeModelToDocumentTask,
  R.map(TEUtils.fromTask)
)

Defined in src/Firestore.ts:279

```haskell
storeModelToDocument :: Document -> ReaderTaskEither Model Model Error
```

##### Type declaration:

▸ (`document`: DocumentReference): *ReaderTaskEither‹[Model](#model), Error, [Model](#model)›*

**Parameters:**

Name | Type |
------ | ------ |
`document` | DocumentReference |

___

#### `Const` storeModelToFirestore

• **storeModelToFirestore**: *function* = pipe(
  getCollectionFromFirestore,
  R.map(storeModelToCollection)
)

Defined in src/Firestore.ts:303

```haskell
storeModelToFirestore :: Firestore -> Reader String (ReaderTaskEither Model Model Error)
```

##### Type declaration:

▸ (`firestore`: Firestore): *Reader‹string, ReaderTaskEither‹[Model](#model), Error, [Model](#model)››*

**Parameters:**

Name | Type |
------ | ------ |
`firestore` | Firestore |

___

#### `Const` updateModelInDocument

• **updateModelInDocument**: *function* = pipe(
  updateModelInDocumentTask,
  R.map(TEUtils.fromTask)
)

Defined in src/Firestore.ts:344

```haskell
updateModelInDocument :: Collection -> ReaderTaskEither Model Model Error
```

##### Type declaration:

▸ (`document`: DocumentReference): *ReaderTaskEither‹[Model](#model), Error, [Model](#model)›*

**Parameters:**

Name | Type |
------ | ------ |
`document` | DocumentReference |

___

#### `Const` validateModel

• **validateModel**: *function* = ifElse(isModel, E.right, () =>
  E.left(new Error('Item is not a valid model.'))
)

Defined in src/Firestore.ts:412

```haskell
validateModel :: a -> Either Model Error
```

##### Type declaration:

▸ (`a`: unknown): *E.Either‹Error, [Model](#model)›*

**Parameters:**

Name | Type |
------ | ------ |
`a` | unknown |

___

#### `Const` validateSnapshotExistence

• **validateSnapshotExistence**: *function* = ifElse(prop('exists'), E.right, () =>
  E.left(new Error('Item does not exist.'))
)

Defined in src/Firestore.ts:401

```haskell
validateSnapshotExistence :: snapshot -> Either a Error
```

##### Type declaration:

▸ (`snapshot`: DocumentSnapshot): *E.Either‹Error, DocumentSnapshot›*

**Parameters:**

Name | Type |
------ | ------ |
`snapshot` | DocumentSnapshot |

### Functions

#### `Const` fromDateModel

▸ **fromDateModel**(`model`: object & A & object): *object & A & object & object*

Defined in src/Firestore.ts:150

```haskell
fromDateModel :: DateModel -> TimestampModel
```

**Parameters:**

Name | Type |
------ | ------ |
`model` | object & A & object |

**Returns:** *object & A & object & object*

___

#### `Const` fromTimestampModel

▸ **fromTimestampModel**(`model`: object & A & object): *object & A & object & object*

Defined in src/Firestore.ts:137

```haskell
fromTimestampModel :: TimestampModel -> DateModel
```

**Parameters:**

Name | Type |
------ | ------ |
`model` | object & A & object |

**Returns:** *object & A & object & object*

___

#### `Const` getCollectionFromDocument

▸ **getCollectionFromDocument**(`document`: DocumentReference‹object›): *(Anonymous function)*

Defined in src/Firestore.ts:255

```haskell
getCollectionFromDocument :: Document -> Reader String Collection
```

**Parameters:**

Name | Type |
------ | ------ |
`document` | DocumentReference‹object› |

**Returns:** *(Anonymous function)*

___

#### `Const` getCollectionFromFirestore

▸ **getCollectionFromFirestore**(`firestore`: Firestore‹›): *(Anonymous function)*

Defined in src/Firestore.ts:211

```haskell
getCollectionFromFirestore :: Firestore -> Reader String Collection
```

**Parameters:**

Name | Type |
------ | ------ |
`firestore` | Firestore‹› |

**Returns:** *(Anonymous function)*

___

#### `Const` getDocumentFromCollection

▸ **getDocumentFromCollection**(`collection`: CollectionReference‹object›): *(Anonymous function)*

Defined in src/Firestore.ts:222

```haskell
getDocumentFromCollection :: Collection -> Reader Model Document
```

**Parameters:**

Name | Type |
------ | ------ |
`collection` | CollectionReference‹object› |

**Returns:** *(Anonymous function)*

___

#### `Const` getQueryFromCollection

▸ **getQueryFromCollection**(`collection`: CollectionReference‹object›): *function*

Defined in src/Firestore.ts:233

```haskell
getQueryFromCollection :: Collection -> Reader [Condition] Document Error
```

**Parameters:**

Name | Type |
------ | ------ |
`collection` | CollectionReference‹object› |

**Returns:** *function*

▸ (`x0`: V0): *T2*

**Parameters:**

Name | Type |
------ | ------ |
`x0` | V0 |

___

#### `Const` getSnapshotFromDocumentTask

▸ **getSnapshotFromDocumentTask**(`document`: DocumentReference‹object›): *(Anonymous function)*

Defined in src/Firestore.ts:358

```haskell
getSnapshotFromDocumentTask :: Document -> Task Snapshot
```

**Parameters:**

Name | Type |
------ | ------ |
`document` | DocumentReference‹object› |

**Returns:** *(Anonymous function)*

___

#### `Const` getSnapshotFromQueryTask

▸ **getSnapshotFromQueryTask**(`query`: Query‹object›): *(Anonymous function)*

Defined in src/Firestore.ts:496

```haskell
getSnapshotFromQueryTask :: Query -> Task Snapshot
```

**Parameters:**

Name | Type |
------ | ------ |
`query` | Query‹object› |

**Returns:** *(Anonymous function)*

___

#### `Const` isDateModel

▸ **isDateModel**(`a`: unknown): *a is DateModel*

Defined in src/Firestore.ts:84

```haskell
isDateModel :: a -> bool
```

**Parameters:**

Name | Type |
------ | ------ |
`a` | unknown |

**Returns:** *a is DateModel*

___

#### `Const` isDateString

▸ **isDateString**(`a`: unknown): *a is string*

Defined in src/Firestore.ts:92

```haskell
isDateString :: a -> bool
```

**Parameters:**

Name | Type |
------ | ------ |
`a` | unknown |

**Returns:** *a is string*

___

#### `Const` isModel

▸ **isModel**(`a`: unknown): *a is Model*

Defined in src/Firestore.ts:64

```haskell
isModel :: a -> bool
```

**Parameters:**

Name | Type |
------ | ------ |
`a` | unknown |

**Returns:** *a is Model*

___

#### `Const` isSerializedModel

▸ **isSerializedModel**(`a`: unknown): *a is SerializedModel*

Defined in src/Firestore.ts:100

```haskell
isSerializedModel :: a -> bool
```

**Parameters:**

Name | Type |
------ | ------ |
`a` | unknown |

**Returns:** *a is SerializedModel*

___

#### `Const` isTimestampModel

▸ **isTimestampModel**(`a`: unknown): *a is TimestampModel*

Defined in src/Firestore.ts:72

```haskell
isTimestampModel :: a -> bool
```

**Parameters:**

Name | Type |
------ | ------ |
`a` | unknown |

**Returns:** *a is TimestampModel*

___

#### `Const` listCollectionsInFirestore

▸ **listCollectionsInFirestore**(`firestore`: Firestore‹›): *(Anonymous function)*

Defined in src/Firestore.ts:462

```haskell
listCollectionsInFirestore :: Firestore -> Task [Collection]
```

**Parameters:**

Name | Type |
------ | ------ |
`firestore` | Firestore‹› |

**Returns:** *(Anonymous function)*

___

#### `Const` listDocumentsInCollection

▸ **listDocumentsInCollection**(`collection`: CollectionReference‹object›): *(Anonymous function)*

Defined in src/Firestore.ts:473

```haskell
listDocumentsInCollection :: Collection -> Task [Document]
```

**Parameters:**

Name | Type |
------ | ------ |
`collection` | CollectionReference‹object› |

**Returns:** *(Anonymous function)*

___

#### `Const` serializeDateModel

▸ **serializeDateModel**(`model`: object & A & object): *object & A & object & object*

Defined in src/Firestore.ts:163

```haskell
serializeDateModel :: DateModel -> SerializedModel
```

**Parameters:**

Name | Type |
------ | ------ |
`model` | object & A & object |

**Returns:** *object & A & object & object*

___

#### `Const` storeModelToFirestoreWith

▸ **storeModelToFirestoreWith**(`firestore`: Firestore‹›): *(Anonymous function)*

Defined in src/Firestore.ts:320

```haskell
storeModelToFirestoreWith :: Firestore -> Reader String (ReaderTaskEither (() -> Model) Model Error)
```

**Parameters:**

Name | Type |
------ | ------ |
`firestore` | Firestore‹› |

**Returns:** *(Anonymous function)*

___

#### `Const` updateModelInDocumentTask

▸ **updateModelInDocumentTask**(`document`: DocumentReference‹object›): *(Anonymous function)*

Defined in src/Firestore.ts:332

```haskell
updateModelInDocumentTask :: Collection -> ReaderTask Model Model
```

**Parameters:**

Name | Type |
------ | ------ |
`document` | DocumentReference‹object› |

**Returns:** *(Anonymous function)*


<a name="modules_index_md"></a>

[functional-firestore](#globalsmd) › ["index"](#modules_index_md)

## Module: "index"

### Index

#### References

* [Condition](#condition)
* [DateModel](#datemodel)
* [Model](#model)
* [Operation](#operation)
* [SerializedModel](#serializedmodel)
* [TimestampModel](#timestampmodel)
* [fromDateModel](#fromdatemodel)
* [fromTimestampModel](#fromtimestampmodel)
* [getCollectionFromDocument](#getcollectionfromdocument)
* [getCollectionFromFirestore](#getcollectionfromfirestore)
* [getDocumentFromCollection](#getdocumentfromcollection)
* [getDocumentSnapshotsFromQuerySnapshot](#getdocumentsnapshotsfromquerysnapshot)
* [getModelFromCollection](#getmodelfromcollection)
* [getModelFromDocument](#getmodelfromdocument)
* [getModelFromFirestore](#getmodelfromfirestore)
* [getModelsFromQuery](#getmodelsfromquery)
* [getModelsFromQuerySnapshot](#getmodelsfromquerysnapshot)
* [getModelsInCollection](#getmodelsincollection)
* [getModelsInCollectionWhere](#getmodelsincollectionwhere)
* [getModelsInFirestore](#getmodelsinfirestore)
* [getModelsInFirestoreWhere](#getmodelsinfirestorewhere)
* [getQueryFromCollection](#getqueryfromcollection)
* [getSnapshotFromDocument](#getsnapshotfromdocument)
* [getSnapshotFromDocumentTask](#getsnapshotfromdocumenttask)
* [getSnapshotFromQuery](#getsnapshotfromquery)
* [getSnapshotFromQueryTask](#getsnapshotfromquerytask)
* [isDateModel](#isdatemodel)
* [isDateString](#isdatestring)
* [isModel](#ismodel)
* [isSerializedModel](#isserializedmodel)
* [isTimestampModel](#istimestampmodel)
* [listCollectionsInFirestore](#listcollectionsinfirestore)
* [listDocumentsInCollection](#listdocumentsincollection)
* [serialize](#serialize)
* [serializeDateModel](#serializedatemodel)
* [serializeTimestampModel](#serializetimestampmodel)
* [storeModelToCollection](#storemodeltocollection)
* [storeModelToDocument](#storemodeltodocument)
* [storeModelToFirestore](#storemodeltofirestore)
* [storeModelToFirestoreWith](#storemodeltofirestorewith)
* [updateModelInDocument](#updatemodelindocument)
* [updateModelInDocumentTask](#updatemodelindocumenttask)
* [validateModel](#validatemodel)
* [validateSnapshotExistence](#validatesnapshotexistence)

### References

####  Condition

• **Condition**:

___

####  DateModel

• **DateModel**:

___

####  Model

• **Model**:

___

####  Operation

• **Operation**:

___

####  SerializedModel

• **SerializedModel**:

___

####  TimestampModel

• **TimestampModel**:

___

####  fromDateModel

• **fromDateModel**:

___

####  fromTimestampModel

• **fromTimestampModel**:

___

####  getCollectionFromDocument

• **getCollectionFromDocument**:

___

####  getCollectionFromFirestore

• **getCollectionFromFirestore**:

___

####  getDocumentFromCollection

• **getDocumentFromCollection**:

___

####  getDocumentSnapshotsFromQuerySnapshot

• **getDocumentSnapshotsFromQuerySnapshot**:

___

####  getModelFromCollection

• **getModelFromCollection**:

___

####  getModelFromDocument

• **getModelFromDocument**:

___

####  getModelFromFirestore

• **getModelFromFirestore**:

___

####  getModelsFromQuery

• **getModelsFromQuery**:

___

####  getModelsFromQuerySnapshot

• **getModelsFromQuerySnapshot**:

___

####  getModelsInCollection

• **getModelsInCollection**:

___

####  getModelsInCollectionWhere

• **getModelsInCollectionWhere**:

___

####  getModelsInFirestore

• **getModelsInFirestore**:

___

####  getModelsInFirestoreWhere

• **getModelsInFirestoreWhere**:

___

####  getQueryFromCollection

• **getQueryFromCollection**:

___

####  getSnapshotFromDocument

• **getSnapshotFromDocument**:

___

####  getSnapshotFromDocumentTask

• **getSnapshotFromDocumentTask**:

___

####  getSnapshotFromQuery

• **getSnapshotFromQuery**:

___

####  getSnapshotFromQueryTask

• **getSnapshotFromQueryTask**:

___

####  isDateModel

• **isDateModel**:

___

####  isDateString

• **isDateString**:

___

####  isModel

• **isModel**:

___

####  isSerializedModel

• **isSerializedModel**:

___

####  isTimestampModel

• **isTimestampModel**:

___

####  listCollectionsInFirestore

• **listCollectionsInFirestore**:

___

####  listDocumentsInCollection

• **listDocumentsInCollection**:

___

####  serialize

• **serialize**:

___

####  serializeDateModel

• **serializeDateModel**:

___

####  serializeTimestampModel

• **serializeTimestampModel**:

___

####  storeModelToCollection

• **storeModelToCollection**:

___

####  storeModelToDocument

• **storeModelToDocument**:

___

####  storeModelToFirestore

• **storeModelToFirestore**:

___

####  storeModelToFirestoreWith

• **storeModelToFirestoreWith**:

___

####  updateModelInDocument

• **updateModelInDocument**:

___

####  updateModelInDocumentTask

• **updateModelInDocumentTask**:

___

####  validateModel

• **validateModel**:

___

####  validateSnapshotExistence

• **validateSnapshotExistence**:

---
_Source: https://npm.io/package/functional-firestore · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
