createData method

  1. @override
Future<void> createData(
  1. String collectionId,
  2. String mid,
  3. Map data
)
override

Implementation

@override
Future<void> createData(String collectionId, String mid, Map<dynamic, dynamic> data) async {
  await initialize();

  logger.finest('createData... $mid!');
  CollectionReference collectionRef = _db!.collection(collectionId);
  await collectionRef.doc(mid).set(data, SetOptions(merge: false));
  // for (MapEntry e in data.entries) {
  //   if (e.value is List) {
  //     await collectionRef.doc(mid).update({e.key.toString(): FieldValue.arrayUnion(e.value)});
  //   }
  // }

  //await collectionRef.add(data);
  logger.finest('$mid! created');
}