2

I want to use like:

const userCollectionRef = db.collection("users");
userCollectionRef
    .doc(userId)
    .populate('hospitals')

My database structure:

1 Answers1

1

According to my understanding populate is rather feature of Mongoose API (reference) than MongoDB itself. Unfortunately official API does not have equivalent, so you have to implement such function by yourself. In the doc you may find all limitation of Firestore querying.

Indeed this is very convenient way to query NoSQL database, but as far as I know there is no API with that feature for Firestore. If you need SQL-join-like queries you may try to follow this question or search for other. Similar questions appears very often.

I hope it will help somehow!

vitooh
  • 4,132
  • 1
  • 5
  • 16