FIREJSON
Firejson is a simple json store lib with a similar syntax of the google firestore database lib, maded with
TypeScript
Installing
npm i --save firejson
Setting data
To set data make like this:
import firejson from 'firejson';
const db = firejson('myDb');
db.collection('myCollection').doc('myDoc').set({ foo: 'bar' });
Getting a doc data
To get data make like this:
import firejson from 'firejson';
const db = firejson('myDb');
const myData: any | boolean = db.collection('myCollection').doc('myDoc').get();
if its gonna throw an error returns false.
Updating a doc data
To update data make like this:
import firejson from 'firejson';
const db = firejson('myDb');
db.collection('myCollection').doc('myDoc').update({ todo: ['myTodoList'] });
Deleting a doc
To delete a doc make like this:
import firejson from 'firejson';
const db = firejson('myDb');
db.collection('myCollection').doc('myDoc').delete();