Installing
$ npm install --save quickfirebase
Example
const database = require("quickfirebase.ts");
const firebaseConfig = {
apiKey: ...,
authDomain: ...,
databaseURL: ....,
projectId: ...,
storageBucket: ....,
messagingSenderId: .....,
appId: .....,
measurementId: .....
};
let schema = {
sales: 0;
}
const databaseManeger = new database(firebaseConfig, {name: "user", default: schema });
databaseManeger.setDefult("mohamed");
More Examples
(async() => {
const data = await databaseManeger.findOne("mohamed");
console.log(data.data.sales);
data.data.sales += 10;
data.save();
delete("mohamed");
})()
Tip
(async() => {
const data = await databaseManeger.findOne("mohamed");
data.data.message = "hello";
data.save();
})()
Menthodes
setDefult()
findOne()
delete()
deleteAll()
Dev
Ziad#1768