I want to get product_id field based on sku field in "variants" collection

Highlighted
New Member
9 0 0

I want to get product_id field based on sku field in "variants" collection

 

if I do this through script it will be very slow at the end. To understand better this is the flow:

Fetch one product from BTS> check if exists > if true get the list of ALL variants > filter ALL variants (can be 200, 500, 1000 of them) by SKU number > return ONE variant based on ("Fetch one product from BTS" sku number) > delete that product

repeat this for each product

if I can delete product by SKU number that would be much more helpful

0 Likes