Question: I'm trying to use an unset magic method to delete a row from the table.

Following is the line of code from execute method of my **CLI command**.

```
$item->unsEquipmentName($input->getArgument(self::INPUT_KEY_NAME));

```

What do I need to add more to get this command working.

The command is registered properly when I check it in the command list and it executes on bash with no error however nothing changes in the database.

How should I close my execute method?

Answer: 
I'm not sure what `$item` is, but I can explain what the methods that start with `uns` do.  

If your `$item` is an instance of a class that inherits `Magento\Framework\DataObject` and you have no method defined called `unsEquipmentName` calling `$item->unsEquipmentName()` is equivalent to `$item->unsetData('equipment_name')`.  

This does not affect you database.  

It just unsets `$_data['equipment_name']` from your object  

Also, this method does not take any parameters.  

you will need to persist your item after unsetting a value.  

You can do that with either `$item->save()` which is not recommended or you can use the repository class for your entity, if you have one.  

Maybe you should explan better what you are trying to achieve.
```
$itemName = $input->getArgument(self::INPUT_KEY_NAME);
        $itemCollection = $this->collectionFactory->create()->getItemsByColumnValue('equipment_name',$itemName); //array type
        $equipment = $this->itemFactory->create();
        $output->writeln('<info>Collection items are ' . var_dump($itemCollection) . '</info>');
        foreach($itemCollection as $key=>$equipment)
        {
            $equipment->load($equipment['id']);
            $equipment->delete();
        }

```