Indexes
async function getUploadsByUser(userId) {
const query = window.firebase
.firestore()
.collection('uploads')
.where('userID', '==', userId)
.orderBy('created', 'desc');
const snapshot = await query.get();
return snapshot.docs.map(doc => doc.data());
}Console index management
Firebase Tools index management
And that's it!
Last updated