Coding a Load and delete Field Collection with Entity API I'm trying to delete all values of a multivalued field containing a field collection. I want access with Entity API wrappers. I use this in a custom rule with hook_rules_action_info()

I'm using drupal 7.39 and field collection modules 7.x-1.0-beta8 and

I'm testing this code but doesn't work for me, this node has 2 values in field_collection

$node_wrapper = entity_metadata_wrapper('node', $node);
dpm($facWrapper-&gt;field_collection,"Field Collection");
//Prints a EntityListWrapper object
dpm($facWrapper-&gt;field_collection-&gt;count(),"Field Collection count");
//Prints zero, it should be 2
dpm($facWrapper-&gt;field_collection-&gt;value(),"Field Collection value");
//Prints array() 0 elements, it should be 2 elements
//And obviously doesn't enter into this foreach, it should enter
foreach ($facWrapper-&gt;field_collection as $fc) {
  dpm($fc,"Field collection item");
}


The questions are:


How to load or access to the field_collection in the entity wrapper way ?
When I have access, How can I delete ? I want to delete the field_collection_item and its reference in the node.
Please look into this links it will give your answers:

Example: Programmatically create and update field collection with Entity API

How to properly delete a field collection

Delete field content using entity metadata wrapper