deleteWithIDs method

Future<void> deleteWithIDs(
  1. Type type,
  2. List<String> ids, {
  3. String? subcollection,
})

Deletes objects in the RDB using a single operation.

Implementation

Future<void> deleteWithIDs(Type type, List<String> ids, { String? subcollection }) async {
  Map<String, dynamic> objectsToDelete = {};

  //For each object, serialize it, and then add it to the list of updates:
  for (final String id in ids) {
    objectsToDelete[RDB.constructPathForClassAndID(type, id, subcollection: subcollection)] = null;
  }

  await RDB.instance.ref().update(objectsToDelete);
}