How to update a field value for a node?
$node = node_load($nid);
$node_wrapper = entity_metadata_wrapper('node', $node);
$node_wrapper-&gt;field_myfield-&gt;set(1);
$node_wrapper-&gt;save();


Entity metadata wrapper is a great way for set or read values of fields in the node!