Following code isn't working to retreive disabled products even after adding respective filter:
/**
* @var \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory
*/
protected $_productCollectionFactory;
.....
$childIds = array(1,2,3); //array of enabled and disabled product ids.
$collection = $this->_productCollectionFactory->create()
->addAttributeToSelect('*')
->addAttributeToFilter('status', \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_DISABLED)
->addAttributeToFilter('entity_id', array('in'=> $childIds))
->load();
Actual: $collection has all enabled products.
Expecting: $collection should have all disabled products from $productIds array. Need help to find disabled products in $childIds array. TIA