How to programmatically set a value to a node attribute
Actually very straight forward, here is how i have done it: 

$group = node_load ( $nid );
$group-&gt; foo = 'bar';
node_save ($group); 


That's it. 

Hope that' ll help anyone.