0

I have collection called books. It's structured like this

{
  title: 'Book',
  text: 'Large amount of text',
  uid: 123
}

On some pages I need only title field and don't need text (that sometimes can be near 10mb in size). How to fetch only those fields that I need ?

As I found from firebase docs I can only get all documents. But nothing about fields.

await db
    .collection('books')
    .where('uid', '==', uid)
    .get();
nl pkr
  • 656
  • 1
  • 11
  • 21
  • 2
    There are no client side APIs the allow the fetch of only certain fields in a document. If you need to improve speed and minimize bandwidth by accessing only certain fields, those certain fields should be in their own document in their own collection. – Doug Stevenson Aug 01 '18 at 20:41
  • Great, Thank you! – nl pkr Aug 01 '18 at 20:42

0 Answers0