Magento2: Not in value Category ids product collection issue

Product collection issue

$productCollection = $objectManager->create(‘MagentoCatalogModelResourceModelProductCollection’);

products = $productCollection->addAttributeToSelect(‘*’)
->addCategoriesFilter(‘category_id’, array(
array(‘nin’ => $currentCategoryId),
))
->setOrder(‘price’, ‘ASC’)
->load();

All topic