How to load out of stock products in magento2 product collection

When I use the below code to load out of products in the collection.it is not able to fetch out of stock product. It depends on catalog > inventory > display out of stock product

How can ignore this setting in below collection

$data = \Magento\Framework\App\ObjectManager::getInstance()->create(‘Magento\Catalog\Model\ResourceModel\Product\Collection’)
->addAttributeToSelect($this->getUsedMagentoAttributes())
->addIdFilter($product_ids)
->setStore($this->_storeModelStoreManagerInterface->getStore())
->addStoreFilter()
->addMinimalPrice()
->addFinalPrice();
$data->setFlag(‘has_stock_status_filter’, false);
$data->load()
->addCategoryIds();

Hello @dhara_gajjar
can you try this way.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();

$productCollectionFactory = $objectManager->create(‘Magento\Catalog\Model\ResourceModel\Product\CollectionFactory’);
$productCollection = $productCollectionFactory
->create()
->addAttributeToSelect(’*’)
->addAttributeToSort(‘created_at’, ‘DESC’)
->joinField(‘stock_item’, ‘cataloginventory_stock_item’, ‘qty’, ‘product_id=entity_id’, ‘qty=0’)
->setPageSize(8)
->load()
;

i hove its help you.
Thanks

Thanks but i want price and other thing as well