Reputation: 134
so i have been trying to create a dynamic firestore collection based on a paremeter of a function, but I want to access it in another function altho i do not know how.
Here is the first function that create the collection :
And here is the second function that I want to access title
from :
Any help is very much appreciated ! Thank you!
CODE :
Future updateBooksData(String category, String title, String author,
String numberOfPages, String description) async {
return await subBookCollection.collection(title).doc(uid).set(
{
'category': category,
'title': title,
'author': author,
'numberOfPages': numberOfPages,
'description': description,
},
);
}
Future getBooksData() async {
return subBookCollection.collection(title).get();
}
Upvotes: 0
Views: 28