Home > Back-end >  How to get 2 fields out of 25 in Firestore?
How to get 2 fields out of 25 in Firestore?

Time:11-30

I'm creating a website where I display products from Firestore. Each document has a fixed number of fields, which is 25. Can I query Firestore using TypeScript to not get the complete documents but only two fields, the product name and the price? I read that for iOS and Android you cannot. How about web?

CodePudding user response:

Firestore client-side SDKs, including the one for browser/web clients, can only retrieve full documents.

Only Firestore's server-side/Admin SDKs have the option to retrieve a subset of the fields of a document.

  • Related