I am new to using magento collections and am receiving exhausted memory fatal errors. I just want to double check that my collection is pulling what i think it is.
I believe this is grabbing all products including the attribute 'part_num'. It then filters out all products with part_num == '' (blank) or ' ' (space).
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('part_num');
$collection->addAttributeToFilter(array(
array('attribute'=>'part_num','neg'=>''),
));
$collection->addAttributeToFilter(array(
array('attribute'=>'part_num','neg'=>' '),
));
This would leave me with all products that have some data in the part_num attribute. Is this correct?