Firebase - App success made simple
Upgrade to Version 3
Installing
$ npm init
$ npm install --save quickfirebase.ts
Example
const quick = require("quickfirebase.ts");
const firebaseConfig = {
apiKey: ...,
authDomain: ...,
databaseURL: ....,
projectId: ...,
storageBucket: ....,
messagingSenderId: .....,
appId: .....,
measurementId: .....
};
let schema = {
sales: 0;
}
quick.connect(firebaseConfig);
const databaseManeger = new quick.database({name: "user", default: schema });
databaseManeger.set("mohamed");
More Examples
(async() => {
const data = await databaseManeger.findOne("mohamed");
console.log(data.data.sales);
data.data.sales += 10;
data.save();
databaseManeger.delete("mohamed");
})()
Tip
(async() => {
const data = await databaseManeger.findOne("mohamed");
data.data.message = "hello";
data.save();
})()
connection
quick.connection.on('connected', async (firebase) => {
console.log("connected to database");
});
Menthodes
set()
findOne()
delete()
deleteAll()
fetch()
Dev
Ziad#1768