0.5.0 • Published 4 years ago

@zwzn/firestore-orm v0.5.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Firestore ORM

Firestore ORM is a class based orm on top of Google Cloud Firestore inspired by Laravel's Eloquent ORM.

Basic Example

import { Model } from '@zwzn/firestore-orm'
import firebase from 'firebase/app'

class Foo extends Model {
    collection = firebase.firestore().collection('foo')

    @Model.field()
    bar: string = ''
}

const f1 = new Foo()
f1.bar = 'baz'

console.log(f1.toJSON()) // { id: undefined, bar: 'baz' }
await f1.save()
console.log(f1.toJSON()) // { id: <random id>, bar: 'baz' }

const f2 = await Foo.find(f.id)
console.log(f2.toJSON()) // { id: <random id>, bar: 'baz' }
0.5.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.3.1

4 years ago

0.2.0

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago