When I run this script from the command line (node script.js
), it seems to work fine. All the activities from Firestore get printed to the console, followed by "done.". But then the script doesn't exit right away. It hangs for exactly 60 seconds, and then I get my prompt back. What's up with that?
Update: Yes, this is the whole script.
const firebase = require('firebase')
const config = {
apiKey: 'AIzaSyBmauMItX-bkUO1GGO_Nvrycy1Y6Pj1o_s',
authDomain: 'fir-test-app-501b1.firebaseapp.com',
databaseURL: 'https://fir-test-app-501b1.firebaseio.com',
projectId: 'fir-test-app-501b1',
}
firebase.initializeApp(config)
firebase.firestore().collection('activities')
.get()
.then(qs => qs.docs.forEach(doc => console.log(doc.data())))
.then(() => console.log('done.'))
I am using Node v8.11.3 and Firebase v5.11.1. GitHub link: https://github.com/danbockapps/firebase60