0

Firestore(web) Help me write a request for random documents based on ID enter image description here

Can I do this without getting the entire collection?

const questions = [];
    const docRef = db.collection('ru').doc(category).collection('questions');
    try {
      const doc = await docRef.get();
      doc.forEach((item) => {
        questions.push(item.data());
      });
    } catch (e) {
      throw e;
    }
Pratik Butani
  • 56,749
  • 54
  • 254
  • 407
sinevitch
  • 13
  • 3

0 Answers0