Lightweight Firebase Cloud Firestore utility library.
Please note: Although this package can be utilized with Firestore Document and Collection References, it may be easier to use the instant-firestore
ORM depending on your requirements.
You can install this package using npm:
$ npm install instant-firestore-utils
Here is a quick example to get you started:
ES Modules
import { getDocument } from 'instant-firestore-utils';
const test = async () => {
const doc = await getDocument(db.collection('countries')); // Assumes db is a Firebase Firestore reference
console.log(doc);
};
CommonJS Modules
var getDocument = require('instant-firestore-utils').getDocument;
getDocument(db.collection('countries')).then(function(doc) {
console.log(doc);
});
We'd greatly appreciate any contribution you make.