getCollection method
CollectionReference<T>
getCollection()
Implementation
CollectionReference<T> getCollection() {
// Assuming that the Query was created from a CollectionReference
if (this is Query<Map<String, dynamic>>) {
return (this as dynamic).parent
as CollectionReference<T>; // Use dynamic to bypass type checks
}
throw Exception('The provided query is not from a collection reference.');
}