New getters for the rest fo the collections
This commit is contained in:
40
tools/invitedGetter.js
Normal file
40
tools/invitedGetter.js
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
const { initializeApp } = require('firebase/app');
|
||||||
|
const {
|
||||||
|
getFirestore,
|
||||||
|
query,
|
||||||
|
getDocs,
|
||||||
|
collection,
|
||||||
|
} = require('firebase/firestore');
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
|
const firebaseConfig = {
|
||||||
|
apiKey: 'AIzaSyBcE9X0ueyczUqpjm0bK9UDrzvDmB96pr4',
|
||||||
|
authDomain: 'lintujamaslo.firebaseapp.com',
|
||||||
|
projectId: 'lintujamaslo',
|
||||||
|
storageBucket: 'lintujamaslo.appspot.com',
|
||||||
|
messagingSenderId: '110340750803',
|
||||||
|
appId: '1:110340750803:web:89f5187720e77fc2788326',
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
initializeApp(firebaseConfig);
|
||||||
|
|
||||||
|
const db = getFirestore();
|
||||||
|
|
||||||
|
getDocs(query(collection(db, 'invited'))).then((docs) => {
|
||||||
|
const titleRow = 'Kutsu\n';
|
||||||
|
fs.writeFile('invited.csv', titleRow, function (err) {
|
||||||
|
if (err) return console.log(err);
|
||||||
|
console.log('STARTED');
|
||||||
|
});
|
||||||
|
docs.forEach((doc) => {
|
||||||
|
const row = doc.id + '\n';
|
||||||
|
fs.appendFile('invited.csv', row, function (err) {
|
||||||
|
if (err) return console.log(err);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
console.log('DONE');
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
40
tools/submittedGetter.js
Normal file
40
tools/submittedGetter.js
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
const { initializeApp } = require('firebase/app');
|
||||||
|
const {
|
||||||
|
getFirestore,
|
||||||
|
query,
|
||||||
|
getDocs,
|
||||||
|
collection,
|
||||||
|
} = require('firebase/firestore');
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
|
const firebaseConfig = {
|
||||||
|
apiKey: 'AIzaSyBcE9X0ueyczUqpjm0bK9UDrzvDmB96pr4',
|
||||||
|
authDomain: 'lintujamaslo.firebaseapp.com',
|
||||||
|
projectId: 'lintujamaslo',
|
||||||
|
storageBucket: 'lintujamaslo.appspot.com',
|
||||||
|
messagingSenderId: '110340750803',
|
||||||
|
appId: '1:110340750803:web:89f5187720e77fc2788326',
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
initializeApp(firebaseConfig);
|
||||||
|
|
||||||
|
const db = getFirestore();
|
||||||
|
|
||||||
|
getDocs(query(collection(db, 'submitted'))).then((docs) => {
|
||||||
|
const titleRow = 'Kutsu\n';
|
||||||
|
fs.writeFile('submitted.csv', titleRow, function (err) {
|
||||||
|
if (err) return console.log(err);
|
||||||
|
console.log('STARTED');
|
||||||
|
});
|
||||||
|
docs.forEach((doc) => {
|
||||||
|
const row = doc.id + '\n';
|
||||||
|
fs.appendFile('submitted.csv', row, function (err) {
|
||||||
|
if (err) return console.log(err);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
console.log('DONE');
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@ const firebaseConfig = {
|
|||||||
messagingSenderId: '110340750803',
|
messagingSenderId: '110340750803',
|
||||||
appId: '1:110340750803:web:89f5187720e77fc2788326',
|
appId: '1:110340750803:web:89f5187720e77fc2788326',
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
initializeApp(firebaseConfig);
|
initializeApp(firebaseConfig);
|
||||||
|
|
||||||
Reference in New Issue
Block a user