0

Let's say I have a huge document in firebase. It looks like this.


root |- bigMap : {
     |     field1: Large amount of data
     |     field2: Large amount of data,
     |     field3: Large amount of data,
     |     field4: Large amount of data,
     |     field5: Large amount of data,
     |     ...
     |  },
     |- bigMap2 : {...},

what if I only want root/bigMap/field3? I don't want to waste data by saying

  (await FirebaseFirestore
    .instance.collection('')
    .doc('root')
    .get()
  )['bigMap']['feild3']

is there any way to only import bigMap/field3?

(I need this in the form of a Future if you need it. It would also be helpful with commented code since I am new to coding)

  • 1
    Does this answer your question? [How to get value of some field in firebase firestore android?](https://stackoverflow.com/questions/47469007/how-to-get-value-of-some-field-in-firebase-firestore-android) – Simon Sot Jun 07 '21 at 07:20
  • (At the time of writing) Only the Firestore REST API allows to apply a `DocumentMask` which "restrict a get or update operation on a document to a subset of its fields". Client SDKs (incl. the Flutter plugin) return the full document. – Renaud Tarnec Jun 07 '21 at 07:30

0 Answers0