getCollectionwithParams<Model extends BaseModel> method
Future<List<Model> >
getCollectionwithParams<Model extends BaseModel>(
- String path, {
- List<
QueryType> ? where, - Map<
String, bool> ? orderby, - int? limit,
- String? startAfterID,
override
Implementation
@override
Future<List<Model>> getCollectionwithParams<Model extends BaseModel>(
String path,
{List<QueryType>? where,
Map<String, bool>? orderby,
int? limit,
String? startAfterID}) async {
var pathParam = path.split("/");
if (pathParam.length.isEven) {
throw GetCollectionGroupError(
"number of ids must be less than paths for subcollection",
StackTrace.current);
}
if (where != null) {
where = checkQueryConstructor(where);
}
try {
DocumentSnapshot? startAfter;
if (startAfterID != null) {
// startAfter = await firestoreRef(path, startAfterID).get();
}
var collection = collectionPath(pathParam);
var collectionReference = queryConstruction(collection,
where: where, orderby: orderby, limit: limit, startAfter: startAfter);
var query = await collectionReference.get();
return parser.parse<Model>(query);
} catch (err, s) {
throw CollectionWithParamsError(err.toString(), s);
}
}