I use the following to code to get data from Firestore using node.js. I would like to keep the output of this query either in a permanent cache or local file system. I'm concern that we lose internet for extended period of time or if the system gets rebooted and doesn't have connection.
const serviceAccount = require('/serviceaccount.json');
fs.initializeApp({credential: fs.credential.cert(serviceAccount)});
const db = fs.firestore();
async function getPlaylist() {
const snapshot = await db.collection('signage-units').doc('a3b1c232').collection('playlists').get();
snapshot.forEach((doc) => {
console.log(/*doc.id, '=>',*/ doc.data());
displayPlaylist(doc.data().player,doc.data().interface,doc.data().path);
});
}```