simpleQueryData method

  1. @override
Future<List> simpleQueryData(
  1. String collectionId, {
  2. required String name,
  3. required String value,
  4. required String orderBy,
  5. bool descending = true,
  6. int? limit,
  7. int? offset,
})
override

Implementation

@override
Future<List> simpleQueryData(String collectionId,
    {required String name,
    required String value,
    required String orderBy,
    bool descending = true,
    int? limit,
    int? offset}) async {
  await initialize();

  List resultList = [];
  CollectionReference collectionRef = _db!.collection(collectionId);
  await collectionRef
      .orderBy(orderBy, descending: true)
      .where(name, isEqualTo: value)
      .get()
      .then((snapshot) {
    resultList = snapshot.docs.map((doc) {
      //logger.finest(doc.data()!.toString());
      return doc.data()! as Map<String, dynamic>;
    }).toList();
  });
  return resultList;
}