I have following cloud function to get data from the firebase datastore but it doesn't compile and am not sure how to fix this.
import * as admin from 'firebase-admin';
import * as functions from 'firebase-functions';
admin.initializeApp(functions.config().firebase);
const db = admin.firestore();
const usersObj = db.collection('users')
export const getUsers = async () => {
let allUsers: Array<any> = [];
await usersObj.get().then(users => {
users.forEach(user => {
allUsers[user.id] = user.data();
});
});
return allUsers;
}
error: error TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'. allOrders[order.id] = order.data();
user.ida number?