updateById method
Implementation
Future<Blob?> updateById(String id, {Map<String, dynamic>? metadata, Uint8List? bytes}) async {
final row = await _collection.getById(id);
if (row == null) return null;
Document? updatedRow = row;
if (metadata != null && metadata.isNotEmpty) {
final data = {...row.data, ...metadata};
final tempUpdatedRow = await _collection.updateById(row.id, data);
if (tempUpdatedRow == null) return null;
updatedRow = tempUpdatedRow;
}
if (bytes != null && bytes.isNotEmpty) {
await _blobDiskDriver.updateChunks(row.id, bytes, _chunksSize);
}
return Blob(id: updatedRow.id, metadata: updatedRow, blobDiskDriver: _blobDiskDriver);
}