repl.it
@functorflow/

bot2firestore

Nodejs

No description

fork
loading
Files
  • index.js
  • Packager files
  • package-lock.json
  • package.json
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const admin = require('firebase-admin');

let serviceAccount = require('./census-267806-527f4388b955.json');


admin.initializeApp({
  credential: admin.credential.cert(serviceAccount)
});


let db = admin.firestore();


let addDoc = db.collection('survey').add({
  name: 'Tokyo',
  country: 'Japan'
}).then(ref => {
  console.log('Added document with ID: ', ref.id);
});

Fetching token
?