insert method

Future insert(
  1. Map<String, dynamic> record
)

Implementation

Future insert(Map<String, dynamic> record) async {
  if (record.containsKey(ID_KEY) && record[ID_KEY] != null) throw Exception("'entityId' must be 'null' to insert the record in collection");
  var entityId = await _collection.generateKey(_database);
  record[ID_KEY] = entityId;
  await _collection.record(entityId).add(_database, record);
}