I have a collection of users and in each document, I want only to get on data which is the array, is there any possible way to only get on, or do I need the whole document?
CodePudding user response:
Try this please. Because its a field, as far as I know, we need to get the whole document first. Hope its help you.
await Firestore.instance.collection('users').document(your document id)
.get().then((Snapshot snapshot){
print(snapshot.data['userCart'])
});