firestore
v1.1.6
Published
Firebase implementation of a simple key/value store
Downloads
13,713
Readme
firestore
Firebase implementation of a simple key/value store
Install
npm install firestore --save
Examples
Del key
var Firestore = require('firestore')
new Firestore({ name: 'pub' }, function firestoreInitialized(err, firestore) {
if (err) {
console.log('ERROR', err)
process.exit(1)
}
firestore.del('somewhere', function(err) {
if (!err) console.log('unexpected')
process.exit(0)
})
})
Get key
var Firestore = require('firestore')
new Firestore({ name: 'pub', path: 'AWS/zone/ap-northeast-1' }, function firestoreInitialized(err, firestore) {
if (err) {
console.log('ERROR', err)
process.exit(1)
}
firestore.get('city', function(err, value) {
console.log((err) ? err.code : value)
process.exit(0)
})
})
Set value
var Firestore = require('firestore')
new Firestore({ name: 'pub' }, function firestoreInitialized(err, firestore) {
if (err) {
console.log('ERROR', err)
process.exit(1)
}
firestore.set('somewhere', 'value', function(err) {
if (!err) console.log('unexpected')
process.exit(0)
})
})