wett-firestore
v1.7.0
Published
this is a plugin for wett db api, it gives you firebase-admin access to the firestore db, you can use the firebase-admin object as a global variable in node js with firebase varibale name this firebase app is initialized with cred and db_url params passed
Downloads
3
Readme
wett-firestore
this is a plugin for wett db api, it gives you firebase-admin access to the firestore db, you can use the firebase-admin object as a global variable in node js with firebase varibale name this firebase app is initialized with cred and db_url params passed in wett db init as object parameters
Installtion
npm i wett-firestore
global.engine = require("wett");
const wett_firestore = require("wett_firestore");
function main(){
let install = await engine.db().install(wett_firestore);
if(install instanceof engine.common.Error){
return install.now("failed-install-wett-firebase-plugin").log();
}
let init = await engine.db("firestore").init({
name:'firestore',
cred:require('./daachi_firestore_key.json'),
url:require('./dbUrl.json').daachi
});
if(init instanceof engine.common.Error){
return init.now("init failed").log(log);
}
}
supported apis
- get
- insert
- update
- increment - only works in integer fields
- delete - not optimized for < 100 documents
- batch - does not support batch reads
- exists - check if doc exists