# instant-firestore

> Firebase Firestore wrapper to ease common tasks, including creating, finding, updating and deleting documents.

Latest version **1.0.8** (published 2018-12-18) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2018-12-18 |
| First published | 2018-09-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 88.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Craig Myles |
| Maintainers | cjmyles |
| Keywords | firestore |

## Links

- npm: https://www.npmjs.com/package/instant-firestore
- Repository: https://github.com/cjmyles/instant-firestore
- Homepage: https://github.com/cjmyles/instant-firestore#readme
- Issues: https://github.com/cjmyles/instant-firestore/issues
- npm.io page: https://npm.io/package/instant-firestore

## Dependencies (2)

- [instant-utils](https://npm.io/package/instant-utils.md) 0.0.1
- [instant-firestore-utils](https://npm.io/package/instant-firestore-utils.md) ^1.0.3

## Recent versions

- 1.0.8 (latest) — 2018-12-18
- 1.0.7 — 2018-12-14
- 1.0.6 — 2018-12-06
- 1.0.5 — 2018-12-06
- 1.0.4 — 2018-12-06
- 1.0.3 — 2018-12-03
- 1.0.2 — 2018-12-03
- 1.0.1 — 2018-12-03
- 1.0.0 — 2018-12-03
- 0.2.0 — 2018-11-21
- 0.1.10 — 2018-11-17
- 0.1.9 — 2018-11-12
- 0.1.8 — 2018-10-01
- 0.1.7 — 2018-09-30
- 0.1.6 — 2018-09-29
- … 8 more at https://npm.io/package/instant-firestore/versions

## README

# Instant Firestore

Firebase Firestore ORM to ease common tasks, such as creating, finding, updating and deleting documents.

_**Please note:** This is an unofficial Firestore package, designed to assist with common Firestore tasks._

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [API](#api)
  - [create](#create)
  - [createMany](#createMany)
  - [find](#find)
  - [findOne](#findOne)
  - [findById](#findById)
  - [createWithId](#createWithId)
  - [update](#update)
  - [delete](#delete)
  - [updateOrCreate](#updateOrCreate)
- [Contributing](#contributing)
- [License](#license)

## Installation

You can install this package using npm:

```bash
$ npm install instant-firestore
```

## Usage

Here is a quick example to get you started:

**ES Modules**

```javascript
import { FirestoreRepository } from 'instant-firestore';

// Pass your firestore instance and a collection reference to the constructor
const fr = new FirestoreRepository(db, db.collection('your-collection-name'));

const data await = fr.findById('12345');
console.log(data);
```

**CommonJS Modules**

```javascript
var FirestoreRepository = require('instant-firestore').FirestoreRepository;

// Pass your firestore instance and a collection reference to the constructor
var fr = new FirestoreRepository(db, db.collection('your-collection-name'));

fr.findById('12345').then(function(data) {
  console.log(data);
});
```

## API

### create

Create a Firestore document.

#### Arguments

`attributes (Object)`: The document attributes.\
`options (Object):` Options.

### Returns

`(Object)`: The serialized document

### createMany

### find

### findOne

### findById

### createWithId

### update

### delete

### updateOrCreate

## Contributing

We'd greatly appreciate any [contribution](CONTRIBUTING.md) you make.

## License

[MIT](LICENSE)

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