I need to get product collection by filter multiple category ids.
Here is my code:
$catId = [2, 3, 5];
$productcollection = $objectmanager->create('\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');
$categoryProducts = $productcollection->addAttributeToSelect('*')
->addAttributeToSort('position', 'ASC')
->addCategoriesFilter(['in' => $catId])
->addAttributeToFilter('color', ['in', $colorValues]);
But this code is not working.